mysql regex get matched string code example Example: mysql regex exact match select * from user where first_name REGEXP '^john$';