小编use*_*061的帖子

C#正则表达式不匹配字符串中的某些单词

我一直在努力寻找解决这个问题的方法.假设有一个字符串

"hello Exclude1 4:32  test test Exclude2 5:23 hello 2:19 some more text 42:3 more text"
Run Code Online (Sandbox Code Playgroud)

我试图创建一个C#至REGx将只匹配2:1942:3 而忽视Exclude1 4:32Exclude2 5:23

即如果前面有Exclude1或Exclude2,则不匹配4:32或n:nn.谢谢

c# regex regex-lookarounds

0
推荐指数
1
解决办法
2636
查看次数

标签 统计

c# ×1

regex ×1

regex-lookarounds ×1