Before posting I’ve searched a lot but I’ve not found what exactly I was searching for. The question is quite simple.
I’ve a text in a table (database MySql) which has to use InnoDB engine (so I can’t use FULL-TEXT search which requires MyIsam as engine). My goal is to find a word in the text. The word, as you can easily guess, can be surrounded by space, tabs, marks and so on and can be at the start, in the middle or at the end of this text.
I know that I can use REGEXP operator and infact I use it but the SQL statement that I made it’s not exactly what I need and so I thought to post the question. This is my actual SQL:
SELECT *
FROM table
WHERE field REGEXP '[[:space:][:graph:]]+THEWORD[[:space:][:graph:]]+'
How I can achieve my goal?
Thanks to everyone.
Use word boundary markers:
(found in the MySQL 5.1 Reference)