I am a Javascript Junkie and wishing to test around some codes.
new RegExp("user=" + un + "[\"'\\s>]", "i")
what will this actually mean?
It was from a site, and it actually works!
I especially don’t get the [\"'\\s>] part.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
[and]signify a character class. Basically, it will match one of any characters found within. The backslash\escapes special characters. So you’ll see that the first double-quote is escaped, showing we’re looking for the"char within the value, and not merely using the"within our regular expression to wrap around a value. Then the single-quote'is considered, followed by a backslash (literal – so it too must be escaped\\looks for one backslash). It appears the original was indicating a space, which is\s. And then the greater-than symbol.