Match the beginning of a string: ^ : Anchor Start « Regular Expressions « MySQL Tutorial






mysql>
mysql>
mysql>
mysql>
mysql> SELECT 'A\nB' REGEXP '^A$';
+---------------------+
| 'A\nB' REGEXP '^A$' |
+---------------------+
|                   0 |
+---------------------+
1 row in set (0.00 sec)

mysql>
mysql> SELECT 'AA' REGEXP '^A';
+------------------+
| 'AA' REGEXP '^A' |
+------------------+
|                1 |
+------------------+
1 row in set (0.00 sec)

mysql>








24.3.Anchor Start
24.3.1.Match the beginning of a string: ^
24.3.2.Get the first name starting with J