in reply to Problem with regex

The way you use regex is very unreliable. The regex system have some reserved characters, If your "string to be matched" has that kind of character, you will confuse the regex. You need to find a module that translates a string to a regex-compatiable search string, or you should translate the string manually.

Replies are listed 'Best First'.
Re^2: Problem with regex
by moritz (Cardinal) on Sep 16, 2008 at 12:12 UTC
    No need for a module, the quotemeta built-in function does that. You can also use \Q$searchstring\E in the regex (which does the same).
Re^2: Problem with regex
by nave448 (Novice) on Sep 16, 2008 at 11:36 UTC
    Thanks. I got the problem