I tried matching keywords with REGEXP in MySQL as following:
-- Match "fitt*", the asterisk "*" is expected to be matched as-is
> select 'aaaa fitt* bbb' regexp '[[:<:]]fitt\*[[:>:]]'; -- return 1, ok
> select 'aaaa fitttttt* bbb' regexp '[[:<:]]fitt\*[[:>:]]'; -- return 1 as well, but should return 0
> select 'aaaa fitt* bbb' regexp '[[:<:]]fitt\\*[[:>:]]'; -- return 0, failed
How to escape the asterisk (*) in order to exactly match the character *?
[[:>:]]. That only matches at a word boundary, but there's no word boundary between*and space because*isn't a word character.fitt*with REGEXP?