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

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -