Link to home
Start Free TrialLog in
Avatar of Mazdajai
MazdajaiFlag for United States of America

asked on

perl module to debug regular expression

I use regexpal / Data::Dumper / YAPE::Regex to test regex and references.

I spend lot of time to debug when lazy / greedy quantifier is involved (such as  .+? vs .* and so on ). It works in regexpal but does not in the code.

In short - Is there a perl module to debug regex? I searched in cpan but haven't been able to find anything.
Avatar of ozo
ozo
Flag of United States of America image

perl -d
runs the Perl debugger, see
perldoc perldebug

Did you have a specific test you want to want to perform?
Avatar of Mazdajai

ASKER

Yes there are couple regular expression that do not work although they works perfectly fine in regexpal.

Thanks for the doc  - Would the following help?

V [pkg [vars]]

Display all (or some) variables in package (defaulting to main ) using a data pretty-printer (hashes show their keys and values so you see what's what, control characters are made printable, etc.). Make sure you don't put the type specifier (like $ ) there, just the symbol names, like this:

    V DB filename line

Use ~pattern and !pattern for positive and negative regexes. 

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I couldn't get debugger to work and other projects came along and put this behind. Perhaps some days I will open a new question if I need to troubleshoot regex again.