Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我只想匹配字符串中的纯数字,例如:
1,100,1000,c4,c5,c6,c10,c100
我也试过这个:</p>
[^c]\d+
它仍然包含以“c”开头的子字符串。
我也试过这个:
[^c\d+]\d+
它排除了那些以 'c' 开头的子字符串,但匹配的是 like ,100,这也不是我想要的。
,100
有什么解决办法?
您可以尝试消极的向后看:
(?<![a-z0-9])\d+