in reply to Filtering out IP addresses
would be a good way to describe an IP address because [0-9] is (barring Unicode) equivalent to \d. Therefore, your first term swallows your following two. You probably want something more like([0-9]?\d\d?|2[0-4]\d|25[0-5])
but this still allows 00, which you may or may not care about.(1?\d\d?|2[0-4]\d|25[0-5])
So how about
It misses spec on match x-counts, but you should probably be scrubbing that too, if you are scrubbing.perl -nle 'print if s/((1?\d\d?|2[0-4]\d|25[0-5])\.){3}(?=\d+)/xxx.xxx +.xxx./g'
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|