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}$';

原文地址:https://www.cnblogs.com/seasonsstory/p/3510392.html