I\'m trying to match some whole-word-expressions with the MySQL REGEXP function. There is a problem, when there are double quotes involved.
The MySQL documentation s
In MySQL 8 and above
Adding to Oleksiy Muzalyev's answer
https://dev.mysql.com/doc/refman/8.0/en/regexp.html#regexp-compatibility
In MySQL 8.04 and above, you have to use:
\bword\b
Where \b represents the ICU variant for word boundary. The previous Spencer library uses [[:<:]] to represent a word boundary.
When actually using this as part of a query, I've had to escape the escape character \ so my query actually looked like
SELECT * FROM table WHERE field RLIKE '\\bterm\\b'
When querying from PHP, use SINGLE quotes to do the same thing
$sql = 'SELECT * FROM table WHERE field RLIKE ?';
$args = ['\\bterm\\b'];
...