I've got a working regex that scans a chunk of text for a list of keywords defined in a db. I dynamically create my regex from the db to get this:
\b(?:keywords|from|database|with|esc\@ped|characters|\@ss|gr\@ss)\b
Notice that special characters are escaped. This works for the vast majority of cases, EXCEPT where the first character of the keyword is a regex special character like @ or $. So in the above example, @ss will not be matched, but gr@ss and esc@ped will.
Any ideas how to get this regex to work for these special cases? I've tried both with and without escaping the special characters in the regex string, but to no avail.
Thanks in advance,
David