如何匹配类似{anyWord}但排除开头有下划线的任何内容,例如:{_doNotMatchThis}?
输入:
hi there {matchPlease}{andThis}, just doing some regex {_notThis}
期望的匹配:
{matchPlease}
{andThis}
如果没有排除 start 的条件{_,我知道这个正则表达式模式运行良好:\{\w+\}
我试图将其修改为\{!_\w+\},基本上是说,“匹配任何以 开头{,然后有一个不以 开头的单词_,然后以”结尾的单词}。谢谢。