为什么我的正则表达式不能用于记事本++?

时间:2014-09-04 07:35:45

标签: regex notepad++

行:

<option value="148">&nbsp; Подарки, сувениры</option>
<option value="96">&nbsp; Товары для дома</option>

我想用notgexp找到notepad ++中的thyes,为此我使用regexp:

/<option value=\"\d{1,3}\">/g

enter image description here

但我得到 0 匹配......

我检查在线测试仪上的regexp,看看它是否有效: enter image description here

但为什么我的正则表达式不能用于记事本++?

2 个答案:

答案 0 :(得分:1)

/.../flags是JavaScript regexp文字表示法。 真实正则表达式实际上是两个/之间的内容,即在您的情况下<option value=\"\d{1,3}\">

附注:在这种情况下,无需转义"<option value="\d{1,3}">

答案 1 :(得分:0)

正如@Jerry在评论中写道:/.... / g是JavaScript正则表达式表示法。 我在Notepad ++中查看了<option value=\"\d{1,3}\">