in reply to
Re: matching a regular expression
in thread matching a regular expression
That's a good trick, as long as the user's input is trusted; otherwise it may cause arbitrary perl code to execute. If you filtered their input to only letters and numbers, it would be safe.
Update:ikegami points out that this is only true if use re 'eval'; is on, and perlre(1) confirms this. \Q/\E should help with the possibility of creating a really slow regex, and reduce the chances of tickling a bug in Perl's regex engion that turns out to be exploitable.
|
Comment on
Re^2: matching a regular expression
Select or Download Code | |
|---|---|
| Re^3: matching a regular expression by blazar (Canon) on May 18, 2006 at 15:56 UTC | |
by Jasper (Chaplain) on May 18, 2006 at 16:05 UTC | |
by blazar (Canon) on May 18, 2006 at 16:08 UTC | |
by japhy (Canon) on May 18, 2006 at 16:13 UTC | |
by blazar (Canon) on May 18, 2006 at 16:22 UTC | |
| Re^3: matching a regular expression by Jasper (Chaplain) on May 18, 2006 at 15:59 UTC | |
| Re^3: matching a regular expression by ikegami (Pope) on May 18, 2006 at 16:31 UTC |