Created
April 23, 2012 09:55
-
-
Save zEvg/2469949 to your computer and use it in GitHub Desktop.
Table of regexps [MySql]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO `regexp_table` (`id`, `name`, `regexp`) | |
VALUES | |
(1,'first','pi|apa'), | |
(2,'second','^(pi|apa)$'), | |
(3,'third','^(pi)*$'), | |
(4,'fourth','^Ba?n'); | |
select * from regexp_table; | |
select T.name, T.`regexp` | |
from regexp_table T | |
where (select 'pi' REGEXP T.`regexp`) = 1; | |
RESULT: | |
first pi|apa | |
second ^(pi|apa)$ | |
third ^(pi)*$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment