mysql>
mysql> SELECT 'ABC' REGEXP '^(ABC)*$';
+-------------------------+
| 'ABC' REGEXP '^(ABC)*$' |
+-------------------------+
| 1 |
+-------------------------+
1 row in set (0.00 sec)
mysql>
mysql> SELECT 'ABC' REGEXP '^(AB)*$';
+------------------------+
| 'ABC' REGEXP '^(AB)*$' |
+------------------------+
| 0 |
+------------------------+
1 row in set (0.00 sec)
mysql>
mysql> SELECT 'ABCABC' REGEXP '^(AB)*$';
+---------------------------+
| 'ABCABC' REGEXP '^(AB)*$' |
+---------------------------+
| 0 |
+---------------------------+
1 row in set (0.00 sec)
mysql>