in reply to Re: Validating Regular Expression
in thread Validating Regular Expression
to filter out code evaluation and pattern code expressions (A bit of magic: executing Perl code in a regular expression), but I'm sure I'd miss some clever escape or exploit of the regex engine. This is the sort of thing where the feature is not worth the effort to secure it properly.sub validate{ my $pat = shift; return if $pat =~ /\(\?{1,2}\{/; return eval{qr/$pat/}; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Validating Regular Expression
by Anonymous Monk on Feb 15, 2011 at 17:54 UTC |