Bug #68271 allow for reverse regex
Submitted: 5 Feb 2013 6:13 Modified: 14 Jun 2013 1:02
Reporter: Ralf Hauser Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any

[5 Feb 2013 6:13] Ralf Hauser
Description:
There should be also a "reverse regex".

Different regex expressions are in a colum.
In the select a string is given.
All rows that contain a matching expression will be returned.

How to repeat:
Table TBL1

key    reg_pattern
----   -----------
1      .*ab.*
2      .*ac.*
3      .*c2.*

select key from TBL1 where reg_pattern  R_REGEX = '01abc23';

should return keys 1 and 3
[7 Feb 2013 12:23] Hartmut Holzgraefe
The following should work? :

  select key from TBL1 where  '01abc23' REGEXP reg_pattern;

Or am i missing something in your question?
[7 Feb 2013 13:27] Ralf Hauser
Apologies for not having tested that the field cannot only be left to the "REGEXP" but also right of it.

Suggestion: Make an example in 

http://dev.mysql.com/doc/refman/5.6/en/regexp.html

Since there is none with a colum/fieldname, but lots of "User Comments" where the values is to the right.
[14 Jun 2013 1:02] Matthew Lord
Hi Ralf,

Thank you for your interest in MySQL, and for helping to make it even better!

I'm closing this FR for now, as this kind of use is rare and I am having trouble thinking of a documentation example that wouldn't be long and/or confusing in the context of the manual page.

If you have any example of the documentation that you think would be good there, then I'm happy to re-open the FR and assign it to the docs team so that they can implement it.

Thanks Again!

Matt