[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

perl module to debug regular expression

Posted on 2014-12-26
5
Medium Priority
?
122 Views
Last Modified: 2015-02-08
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.
0
Comment
Question by:Mazdajai
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 40519009
perl -d
runs the Perl debugger, see
perldoc perldebug

Did you have a specific test you want to want to perform?
0
 
LVL 21

Author Comment

by:Mazdajai
ID: 40519015
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

0
 
LVL 84

Accepted Solution

by:
ozo earned 1800 total points
ID: 40519030
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.
0
 
LVL 75

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 200 total points
ID: 40519836
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.
0
 
LVL 21

Author Comment

by:Mazdajai
ID: 40596957
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.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Six Sigma Control Plans

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question