Match the end of a string: $ : Anchor End « Regular Expressions « MySQL Tutorial






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

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

mysql>








24.2.Anchor End
24.2.1.Match the end of a string: $
24.2.2.Get the first name ending with n