MySQL Tutorial/Regular Expressions/word
Версия от 13:44, 26 мая 2010; (обсуждение)
Match the beginning and end of words, respectively( [[:<:]], [[:>:]] )
mysql>
mysql> SELECT "a word a" REGEXP "[[:<:]]word[[:>:]]";
+----------------------------------------+
| "a word a" REGEXP "[[:<:]]word[[:>:]]" |
+----------------------------------------+
| 1 |
+----------------------------------------+
1 row in set (0.00 sec)
mysql>
mysql> SELECT "a xword a" REGEXP "[[:<:]]word[[:>:]]";
+-----------------------------------------+
| "a xword a" REGEXP "[[:<:]]word[[:>:]]" |
+-----------------------------------------+
| 0 |
+-----------------------------------------+
1 row in set (0.00 sec)
mysql>
mysql>