Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Regex help

by Anonymous Monk
on Sep 10, 2012 at 03:58 UTC ( #992659=note: print w/ replies, xml ) Need Help??


in reply to Regex help

Because it does :) Add

use re 'debug';
and watch the regex engine match the thing

Also see

use YAPE::Regex::Explain; print YAPE::Regex::Explain->new( qr/(.+)(\/path\/)(.+)(\/.+)/ )->explain; __END__ The regular expression: (?-imsx:(.+)(/path/)(.+)(/.+)) matches as follows: NODE EXPLANATION ---------------------------------------------------------------------- (?-imsx: group, but do not capture (case-sensitive) (with ^ and $ matching normally) (with . not matching \n) (matching whitespace and # normally): ---------------------------------------------------------------------- ( group and capture to \1: ---------------------------------------------------------------------- .+ any character except \n (1 or more times (matching the most amount possible)) ---------------------------------------------------------------------- ) end of \1 ---------------------------------------------------------------------- ( group and capture to \2: ---------------------------------------------------------------------- /path/ '/path/' ---------------------------------------------------------------------- ) end of \2 ---------------------------------------------------------------------- ( group and capture to \3: ---------------------------------------------------------------------- .+ any character except \n (1 or more times (matching the most amount possible)) ---------------------------------------------------------------------- ) end of \3 ---------------------------------------------------------------------- ( group and capture to \4: ---------------------------------------------------------------------- / '/' ---------------------------------------------------------------------- .+ any character except \n (1 or more times (matching the most amount possible)) ---------------------------------------------------------------------- ) end of \4 ---------------------------------------------------------------------- ) end of grouping ----------------------------------------------------------------------


Comment on Re: Regex help
Select or Download Code
Re^2: Regex help
by yoda54 (Monk) on Sep 10, 2012 at 04:07 UTC
    Thanks!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (20)
As of 2014-07-22 14:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (116 votes), past polls