I want a regex that has a string (a-z, A-Z, 0-9, can include '\', '/' and white sapces)
I tried it like this:
if (/[\s\\\/A-Za-z0-9]$/.test(Yourval)),
but it doesn’t work well, can somebody help me? thanks!
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.
This should work:
… as you need two anchors here (both for the start and the end of the string), and
+quantifier to test for more than a single character. In fact, this can be rewritten just as…… so we test for bad characters instead of trying to cover the string with only good ones. )