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.
LVL 21
Who is Participating?
ozoConnect With a Mentor Commented:
the V command in the debugger will help if you don't know what variables you have in your package.
but if you know what variables you want to look at, the p or x commands may be more useful.
perl -d
runs the Perl debugger, see
perldoc perldebug

Did you have a specific test you want to want to perform?
MazdajaiAuthor Commented:
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

käµfm³d 👽Connect With a Mentor Commented:
Keep in mind that all regex implementations are different. They work differently and most support different syntaxes. Regex is not guaranteed to be portable. RegexPal uses Javascript's regex engine. This is not the same engine that Perl uses.
MazdajaiAuthor Commented:
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.