oh, I didn't notice that matched the third line. Unforunately, I don't agree with your solution. That is to say I don't think we can provide a solution with the information he provided us. For example, all of the following match his criteria, yet all are different:
- /\b\Q$find\E\b/
- /(?<!\S)\Q$find\E/(?!\S)
- /\Q$find\E/(?!\.)
- /\Q$find\E$/
- /\Q$find\E$/m
- /\Q$find\E\z/
- ...
The op should have a look at perlre. (Or should I say "another look" since he should already have looked there when he started having problems with his regexp...)