Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Patternmatching IPaddresses

by choroba (Abbot)
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 wandering the Monastery: (4)
As of 2014-07-13 08:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (248 votes), past polls