Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: How will my regular expression match?

by dpavlin (Friar)
on Jul 11, 2004 at 00:09 UTC ( #373416=note: print w/ replies, xml ) Need Help??


in reply to How will my regular expression match?

Allthough, this is repetitive, using one-liners like:

perl -e "use re 'debug'; print 'this is a demo' =~ /\w+/;"
helped me more than once (it's even more useful with complex regexes :-). It'a a shame that you have to dig into perldebug to find it. I think it should be mentioned in perlre also.

2share!2flame...


Comment on Re: How will my regular expression match?
Download Code
Re^2: How will my regular expression match?
by hv (Parson) on Jul 11, 2004 at 03:13 UTC

    I use this a lot, usually with the shorter command-line invocation ('-Dr', available if perl was built with debugging enabled). However the output was designed primarily for internals debugging, and is likely to be more scary than helpful to the casual user.

    Various people have taken advantage of the information it provides to offer a friendlier interface to regexp debugging. Though I haven't tried any of them, I'm aware of ReBug (I believe this is open source, but I can't get to the website: the author gave a talk on it at the 2001 OSCON), Komodo (commercial, with "try before you buy"), and The Regex Coach ("donationware", donate if you like it) which was recently mentioned on PM.

    Hugo

Re^2: How will my regular expression match?
by diotalevi (Canon) on Jul 11, 2004 at 04:00 UTC
    There's also the shorter, perl -Mre=debug -e ' ... ' for those people without a debugging perl.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://373416]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2014-09-01 14:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (13 votes), past polls