【发布时间】:2019-01-28 06:30:10
【问题描述】:
我正在使用下面的正则表达式来匹配包含小数、引号 (") 内的负数的数字。 我应该进行哪些更改以使其与“#1200”不匹配?
\"(-?\d*.?\d+)\"
"1200" ---> matches as expected
"1200.67" ---> matches as expected
"-1200" ---> matches as expected
"-1200.67" ---> matches as expected
"#1200" ---> I'm not expecting this to match. As you can see It has # at the beginning.
【问题讨论】:
-
你需要转义
.。
标签: c# .net regex regex-negation