我正在尝试匹配一个a
没有用反斜杠转义的字母(比方说),但我想在不使用负前瞻或负后瞻的情况下做到这一点,这是我迄今为止尝试过的,但它不起作用
/([^\\][^a])*/.test('should be true a.'); // true
/([^\\][^a])*/.test('should be not true \\a.'); // true
但他们都返回真。我究竟做错了什么?
我正在尝试匹配一个a
没有用反斜杠转义的字母(比方说),但我想在不使用负前瞻或负后瞻的情况下做到这一点,这是我迄今为止尝试过的,但它不起作用
/([^\\][^a])*/.test('should be true a.'); // true
/([^\\][^a])*/.test('should be not true \\a.'); // true
但他们都返回真。我究竟做错了什么?