- s = "abc1" & vbCrLf & _
- "abc2" & vbCrLf & _
- "a--bc3" & vbCrLf & _
- "axc4" & vbCrLf
-
- With New RegExp
- .IgnoreCase = True
- .Global = True
- .MultiLine = False
- .Pattern = "[\s\S]*?(?!--)[\s\S]*?c"
- If .Test(s) = False Then
- Msgbox "没找到"
- wscript.quit
- End If
- for each a in .execute(s)
- msgbox a
- next
- End With
复制代码 我是想不匹配有--的内容
应该怎么构建 |