[thelist] Regular expression to check if other regularexpressions are valid

lustig at brandeis.edu lustig at brandeis.edu
Wed Jun 22 17:40:17 CDT 2005


> If eval is available in your language of choice you can
> use it to test the validity of a regex.

But if you just eval the regular expression, like this (in php)

eval("preg_match('/badregex', 'asdfasf');");

... then wouldn't it just throw an error as if you ran the code natively? In
my experience, eval() doesn't suppress errors.

Jason


More information about the thelist mailing list