如何编写一个正则表达式,接受一个包含任意数字的表达式,除了' [',除非' ['前面有' \'?
例:
this is text \\[ this also [$ this isn't any more
Run Code Online (Sandbox Code Playgroud)
从上面的文字中," this is text \\[ this also"应该被接受,其余的不应该被接受.我写了类似的东西:
[.[^\\\\[]]*
Run Code Online (Sandbox Code Playgroud)
排除' ['但不知道如何允许它包含' \\['以及文本的其余部分.