如何编写一个接受包含除 ' ' 之外的任意数量的任何字符的表达式的正则表达式[,除非 ' [' 前面有 ' \' ?
例子:
this is text \\[ this also [$ this isn't any more
从上面的文字来看,“ this is text \\[ this also”应该被接受,其余的不应该。我写了类似的东西:
[.[^\\\\[]]*
排除 ' [' 但不知道如何允许它包含 ' \\[' 以及其他文本。