
mhx
Enthusiast
Jun 29, 2001, 7:54 AM
Post #2 of 2
(12597 views)
|
Hi, say your regex is stored in $re, then you can test if it's valid with
eval { '' =~ /$re/ }; unless( $@ ) { print "Regex is valid!\n"; } else { print "Regex is invalid!$@"; } Hope this is what you were looking for. -- Marcus
(This post was edited by mhx on Jun 29, 2001, 6:59 AM)
|