regexp mysql all except string after last symbol code example Example: mysql regexp match word SELECT * FROM table WHERE keywords REGEXP '[[:<:]]rid[[:>:]]'