For some reason I can’t seem to use non-capturing groups in MySQL. Is there a way to use them in a MySQL REGEXP?
For non-capturing groups in PHP’s PCRE implementation, I use this syntax:
(?:[PATTERN])
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.
Groups in MySQL regular expressions are not capturing groups, since capturing groups in SQL wouldn’t make much sense… well, not without the addition of syntax to support using the captured substrings. So it doesn’t support the
(?: )syntax, since this syntax is pointless within MySQL — the groups already don’t capture.So,
([PATTERN])IS a non-capturing group.