in reply to Filtering out IP addresses

In general, I agree with AppleFritter's comment; a regular expression is developed according to the environment in which it must operate. With regard to the code you've posted, I wouldn't think
([0-9]?\d\d?|2[0-4]\d|25[0-5])
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
(1?\d\d?|2[0-4]\d|25[0-5])
but this still allows 00, which you may or may not care about.

So how about

perl -nle 'print if s/((1?\d\d?|2[0-4]\d|25[0-5])\.){3}(?=\d+)/xxx.xxx +.xxx./g'
It misses spec on match x-counts, but you should probably be scrubbing that too, if you are scrubbing.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.