12-09-2007, 03:42 PM
|
#13 (permalink)
|
|
The Contributor
Join Date: Dec 2007
Location: Belgium
Posts: 60
Thanks: 6
|
Quote:
Originally Posted by Wildhoney
5: REGEXP
Last but not least, REGEXP can be used in MySQL in place of the more primitive LIKE. It uses the standard PCRE syntax.
|
Quote from http://dev.mysql.com/doc/refman/5.0/en/regexp.html:
Quote:
|
MySQL uses Henry Spencer's implementation of regular expressions, which is aimed at conformance with POSIX 1003.2.
|
Just for the record, that's another regex flavor than PCRE. I believe it's the same as the PHP ereg functions.
Word boundary metacharacters, for example, are not \b but [[:<:]] and [[:>:]].
Also I believe POSIX keeps on searching for the longest match, whereas PCRE returns the first found match. Sounds a bit vague probably, anyway, my point is that MySQL's REGEXP and PCRE are not the same.
|
|
|
|