作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
好的,这是正则表达式:
Match CMD = Regex.Match(CommandString, @"\(([a-z0-9]+);(INTEGER|DECIMAL|STRING);(d{1,3});(((YES|NO);){3})([a-z0-9]+)\)", RegexOptions.IgnoreCase);
if (CMD.Success){
return true;
}
return false;
以下模式应返回 true:
(ID;Integer;12;YES;YES;YES;0)
(weak;String;5;NO;YES;YES;super)
(fabris345;decimal;23;YES;YES;YES;0)
(expr12nd;String;455;NO;YES;NO;super1000)
但它们总是返回 false。为什么?
最佳答案
...(d{1,3})...应该是 (\d{1,3})
关于regex - 我不明白为什么这个正则表达式总是返回 false?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20088891/
我是一名优秀的程序员,十分优秀!