SELECT 'AaYYY1231' REGEXP '[A-Z,0-9]+';
Result:
1
Why is it returning 1, when I expect it to return 0 ?
From where is is it finding match for ‘a’ ?
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.
http://dev.mysql.com/doc/refman/5.1/en/regexp.html
“REGEXP is not case sensitive, except when used with binary strings.”
An example from the doc:
Additionally, it’s not greedy, so it doesn’t ensure that the entire string matches. Modifying the example above yields:
To account for this, you can add flags for the beginning and end of the line:
This leads to the final answer of what you want: