Mega Code Archive

 
Categories / MySQL Tutorial / Regular Expressions
 

Match the end of a string

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