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

Re^5: Seeker of Regex Wisdom (strings which don't form specific patterns)

by shmem (Chancellor)
on Aug 13, 2015 at 12:29 UTC ( [id://1138419]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Seeker of Regex Wisdom (strings which don't form specific patterns)
in thread Seeker of Regex Wisdom (strings which don't form specific patterns)

Unfortunately, capture groups don't change their numbering under a counted quantifier

One way to overcome that is keeping track oneself:

$_ = '192.168.2.111'; my @l; /^(?:([01]?\d\d?|2[0-4]\d|25[0-5])(?{push@l,$1})\.){3}([01]?\d\d?|2[0- +4]\d|25[0-5])$/; print join('-',@l,$2),"\n"; __END__ 192-168-2-111
perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-03-19 11:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found