Ovid has asked for the wisdom of the Perl Monks concerning the following question:
Is there some way to watch the regex engine as it goes along? I'm thinking something similar to the Perl's debugger.die "Bad number!\n" if $number !~ /(?:[\d]{1,6}\.[\d]{0,5})|(?:[\d]{0,5}\.[\d]{1,6})|( +?:[\d]{1,7})/; $count ++ if $stuff =~ /(?i:p)rods(?:\\s+(?:[^&]|&(?!gt;))+)?/;
I actually use the /x modifier and comment them heavily, which helps. I've reduced them to one line above for effect.
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just go the the link and check out our stats.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Regex Testing
by chromatic (Archbishop) on Sep 27, 2000 at 03:49 UTC | |
by converter (Priest) on Sep 27, 2000 at 05:03 UTC | |
by Anonymous Monk on Dec 03, 2001 at 22:07 UTC | |
RE: Regex Testing
by Adam (Vicar) on Sep 27, 2000 at 03:58 UTC | |
RE: Regex Testing
by meonkeys (Chaplain) on Sep 27, 2000 at 20:41 UTC | |
Re: Regex Testing
by princepawn (Parson) on Sep 27, 2000 at 16:36 UTC |