in reply to Checking user input on dynamic regular expressions

I don't know why you think you need to escape the / character. You're using the q quoting mechanism, so the $input is not interpolated, thus it is the regex compiler, not the perl parser, that sees the / so if you're worried about a / being used to terminate the regex, that won't happen. That being said, if you are escaping a character, you may also want to escape the \ character, in your example an $input of '\/' would become '\\/' which does not have an escaped /

Replies are listed 'Best First'.
Re: Re: Checking user input on dynamic regular expressions
by cLive ;-) (Prior) on Apr 02, 2001 at 12:34 UTC
    oops, good point. Earlier, I was messing with an interpolated version and slipped that in for safety.

    Guess that makes most of my above question irrelevant :)

    ah well

    cLive ;-)