Page 1 of 1

Tip: mySQL has REGEX built in

Posted: Mon Oct 06, 2003 7:46 am
by Cruzado_Mainfrm
examples of regex:

will show artist that start with a number

Code: Select all

SELECT artistname FROM artists WHERE artistname REGEXP "^ї0-9]"
will return 1(boolean):

Code: Select all

SELECT "myword" REGEX "^my.*rd$"
will return 1(boolean):

Code: Select all

SELECT "that was nice" REGEX "&#1111;&#1111;:<:]]was&#1111;&#1111;:>:]]"
the reference:
http://www.mysql.com/doc/en/Regexp.html

Posted: Mon Oct 06, 2003 8:45 am
by nigma
Thanks Cruzado, this post will surely save me an hour or so of time in the future.