Hi,
I have been running a little server for a while, and i am wondering how many people have used it. The server creates crappy logfiles.
I am trying to find the command which would allow me to print only the matching characters per line in the input file and follw each result with a line break.
The results therefore should look something like this (a list of all ip addresses from a bunch of crappy logfiles):
Code:
64.1.2.3
126.89.42.22
5.23.95.45
...
and so on.
I was thinking about a program which matches something like this:
Code:
[:digit:]\{1,3\}\.[:digit:]\{1,3\}\.[:digit:]\{1,3\}\.[:digit:]\{1,3\}
(I hope the above regular expression is correct. It should match all numbers in the following pattern nnn.nnn.nnn.nnn
The program is only supposed to print matches of the expression, not the entire line of its context.
THANKS!!