Difference between revisions of "Regular expressions"
From MyWiki
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
'''Example''' | '''Example''' | ||
− | < | + | <source lang="sql"> |
− | mysql> select uid,whencreated,employeetype,mail,proxyaddresses from adfields where employeeType='Student' and proxyaddresses not like '%alumni%' and proxyaddresses not regexp 'smtp:[a-z]{2,3}[0-9]' | + | mysql> select uid,whencreated,employeetype,mail,proxyaddresses from adfields where employeeType='Student' |
+ | and proxyaddresses not like '%alumni%' and proxyaddresses not regexp 'smtp:[a-z]{2,3}[0-9]' | ||
+ | and mail not regexp '^[a-z]{2,3}[0-9]' order by whencreated desc ; | ||
</source> | </source> |
Latest revision as of 12:33, 4 October 2014
http://www.tutorialspoint.com/mysql/mysql-introduction.htm
http://www.tutorialspoint.com/mysql/mysql-regexps.htm
Example
mysql> SELECT uid,whencreated,employeetype,mail,proxyaddresses FROM adfields WHERE employeeType='Student' AND proxyaddresses NOT LIKE '%alumni%' AND proxyaddresses NOT REGEXP 'smtp:[a-z]{2,3}[0-9]' AND mail NOT REGEXP '^[a-z]{2,3}[0-9]' ORDER BY whencreated DESC ;