I have a rather complex regex that I'm throwing text at.
if($str=~m/\Athing1\:thing2\,thing3\@(\w+)\?(\d+)\Z/){
# process str
} else {
die "bad str 'str' ";
}
Is there a way to get better built in reporting with regexps?
with the above, if the string doesn't match, I get "bad input".
What I'd rather get is something like "expecting \:thing2"
if need be, I'll break it into a series of nested ifs.
but that would be exceedingly ugly.
The pattern does not require backtracking.
I've already checked that I'm in a certain location and only one kind of
input is expected.
and again, I can't load external modules at work.
suggestions?
Greg
_______________________________________________
Boston-pm mailing list
[email protected]
https://mail.pm.org/mailman/listinfo/boston-pm