Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: How will my regular expression match?

by dpavlin (Friar)
on Jul 11, 2004 at 00:09 UTC ( [id://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...

Replies are listed 'Best First'.
Re^2: How will my regular expression match?
by hv (Prior) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://373416]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-16 08:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found