MySQL has decided not to play ball with a certain regular expression I put together. The grand plan is for it to match a string which might or might not be terminated by a punctuation mark.
I have entered the following into 2 apps designed to validate regular expressions, and in both cases the expression works flawlessly:
\bString\b[[:punct:]]?
But the moment this is introduced to MySQL as
[[:<:]]String[[:>:]][[:punct:]]?
Then it doesn’t work at all. It will accept String but not String! or String;
I am at wit’s end, so if anyone could shed some light on this, I would be deeply grateful!
TIA 🙂
[[:>:]]means end of word. Usually a space.String(note the spaces) matches.String!does not match.Change the regex into: