Mega Code Archive

 
Categories / MySQL Tutorial / Regular Expressions
 

Match the beginning of a string

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>