November 23, 2007 1 Comment
I have come up with this regex:
(yes, it’s old-style ereg syntax for use in a MySQL statement)
In PCRE syntax it’d look like:
It will match ‘T P’, ‘Tony P’, Tony Parsons’, ‘Some Tiny People’…
So far so good. Unfortunately I need to find a way to tell it NOT to match certain words, such as ‘The’.
i.e. it should match ‘Theremin Player’ and ‘The Tree Party’, but not ‘The Pastors’ or ‘Tony The Pony’.
If I was doing this in PHP it’d be easier, but since it’s in a MySQL statement I need to somehow perform that operation all in one (old-style…) regex. And I’m stumped.
I need to do something like:
followed by t, followed by zero or more word characters (but not he),
If anyone knows how to do this it’d be a big help!