regex for testing "\" in string -


this question has answer here:

why regexp returns false for

/[\\]/igm.test('asdasdasd\asdasd'); 

and true

/[\\]/igm.test('asdasdasd\\asdasd'); 

and when try gives error, why..?

/[\\]/igm.test('abc\xyz'); 

\x character escape ascii character, next 2 characters must hexidecimal digits. so, \xyz invalid because y , z aren't hex digits.


Comments

Popular posts from this blog

php - trouble displaying mysqli database results in correct order -

depending on nth recurrence of job in control M -

sql server - Cannot query correctly (MSSQL - PHP - JSON) -