To find names containing exactly five characters, use “^”and “$”to match the beginning and end of the name, and five instances of “.”in between: mysql

To find names containing exactly five characters, use “^”and “$”to match the beginning and end of the
name, and five instances of “.”in between:
mysql> SELECT * FROM pet WHERE name REGEXP '^.....$';

或者

SELECT * FROM pet WHERE name REGEXP '^.{5}$';

posted on 2014-01-08 11:52  语辰  阅读(211)  评论(0编辑  收藏  举报