in reply to RE: RE: Re: Converting RegExs.
in thread Converting RegExs.

And, of course, you can compile the regex that they entered using qr//. You should run that in an eval and if it fails then you know that they've entered and invalid regex and you can go back and ask for a better one.

--
<http://www.dave.org.uk>

European Perl Conference - Sept 22/24 2000, ICA, London
<http://www.yapc.org/Europe/>

Replies are listed 'Best First'.
RE (tilly) 5: Converting RegExs.
by tilly (Archbishop) on Sep 04, 2000 at 18:40 UTC
    And when they wonder why /5/ doesn't match 5?
    perl -e '$in = "/5/"; $m = qr/$in/; print 1 if 5 =~ $m'