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

Re: Patternmatching IPaddresses

by choroba (Canon)
on Jun 21, 2013 at 22:48 UTC ( #1040234=note: print w/ replies, xml ) Need Help??


in reply to Patternmatching IPaddresses

The other string is not at the beginning of a line. Remove the ^. Also, a dot is a special character in regexes. Backslash it to match literally. You do not need the replaced numbers - no need for capturing parentheses. You do not want the third and fourth numbers to be replaced - you can achieve this by requiring a dot after the numbers to be replaced:

s/\d*\.\d*\./X.X./g
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: Patternmatching IPaddresses
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (14)
As of 2015-07-02 12:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (37 votes), past polls