[英]How Can I Create a Regular Expression to Match a String Like This?
I am using Cloud9's IDE and want to use their regex search/replace feature to find all lines of code that look like this: 我正在使用Cloud9的IDE,并希望使用其正则表达式搜索/替换功能来查找看起来像这样的所有代码行:
LINE -(xxx, yyy)
Example: 例:
LINE -(135, 400)
I came up with 我想出了
/LINE -\\(\\d{1,3}, \\d{1,3}\\)\\n/g
This works in RegExr but not in Cloud9 . 这在RegExr中有效,但在Cloud9中无效 。 I've tried a few variations without any luck.
我尝试了几种变体,没有任何运气。 Any ideas?
有任何想法吗?
A few notes about Cloud9 find panel using a Regex: 有关使用Regex的Cloud9查找面板的一些说明:
/
delimiters /
分隔符 /g
is also not needed /g
也不需要 .*?
.*?
I tried the above regex with a dummy file and it worked. 我用一个虚拟文件尝试了上面的正则表达式,它起作用了。 Here's the final find query I gave:
这是我给的最终查找查询:
LINE -\(\d{1,3}, \d{1,3}\)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.