The 'class name' section of the reference actually contains regex characters. I'm not aware of any other way to check this than looking for invalid package name characters in the ref. Sorry.my $class = 'Temp(a?)'; my $re = qr/test/io; my $regex = bless $re, $class; print "Verbatim: $regex\n"; print "Ref: ", ref($regex), "\n";
Update: I completely misread the original question, and am now looking for a way to redeem myself by giving a *good* answer. :|
Check this out:
It displays correctly unless you bless it into another class. Of course, it matches in both the qr and the re-blessed form, which indicates to me that *something* keeps track of whether or not it's a regex, no matter what class name it keeps around.my $re = qr/(test)/io; print "Verbatim: $re\n"; print "Ref: ", ref($re), "\n";
In reply to Re: Dumping Compiled Regular Expressions
by chromatic
in thread Dumping Compiled Regular Expressions
by Hrunting
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |