Why this regexp returns false for
/[\\]/igm.test('asdasdasd\asdasd');
and true for
/[\\]/igm.test('asdasdasd\\asdasd');
and when I try this it gives error, why..?
/[\\]/igm.test('abc\xyz');
Why this regexp returns false for
/[\\]/igm.test('asdasdasd\asdasd');
and true for
/[\\]/igm.test('asdasdasd\\asdasd');
and when I try this it gives error, why..?
/[\\]/igm.test('abc\xyz');
\x
is a character escape for an ASCII character, where the next two characters must be hexidecimal digits. So, \xyz
is invalid because y and z aren't hex digits.