Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想匹配我试过的ruby 1.9中没有反斜杠的每个'['或']':
/?<!\134[\[\]]/
和
/?<!\\\\[\[\]]/
但我得到一个“未指定重复运算符的目标”
您需要将否定的lookbehind 括在括号中。
(?<!\\)[\[\]]