Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Parenthesis grouping into regexes.

by aramisf (Beadle)
on Apr 26, 2012 at 18:45 UTC ( #967435=note: print w/replies, xml ) Need Help??


in reply to Re^2: Parenthesis grouping into regexes.
in thread Parenthesis grouping into regexes.

Labelling groups (with (?pattern) regex) showed me what was happening. It is all clear now.

Many thanks to everyone, specially BillKSmith!

I was having a trouble when using $1, $2... because I didn't know they exact behaviour.

The problem I had was with the parenthesis inside $ip4 regex, causing $2 to have an ip address,
$3 had the match inside the parenthesis in $ip4, and the prefix I expected put into $4:
# Example of my debug output: line = '*> 177.101.16.0/21 200.19.74.230 0 200' matches: $1:'*> ' $2:'177.101.16.0' $3: '16.' $4:'/21'

Now I understand how $1, $2, $3... are set.
Thank you all, Monks! =D

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://967435]
help
Chatterbox?
[Corion]: marto: Oh, I'm jealous. I'm going to see DM in Frankfurt, but it's a stadium full of people, so, rather a big thing where you mostly get to see the band on screens ;)
[marto]: yes, the last time I saw them was in Berlin a few years ago, at the old Olympic stadium
[marto]: After Sunday I don't think I'll go see them again :)

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (11)
As of 2017-03-24 11:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (301 votes). Check out past polls.