Has anyone found that REGEX “\b” doesn’t work in MYSQL?
I have a nice piece of regex that matches well using regex engines
But when I use it as part of a MYSQL query
WHERE ( e.department REGEXP '^(//)?w7\b' )
it will not match. If I remove the \b component, the match works well but its not to the accuracy that I need with the \b (basicly I need to match the whole word W7 only)
For MySQL versions prior to MySQL 8.0.4, the
REGEXP (MySQL 5.6 ref) docs indicate that the start-of-word/end-of-word markers are:
These markers stand for word boundaries. They match the beginning and end of words, respectively.
WHERE ( e.department REGEXP '^(//)?w7[[:>:]]' )
\b is used for word boundary instead.
Answered By – Mat