From: bob_smithley on 15 Oct 2007 08:08 I am getting closer: sed -e "s/\x00[0-9]\x00[0-9]\x00[0-9]\x00\. \x00[0-9]\x00[0-9]\x00[0-9]\x00.\x00[0-9]\x00[0-9]\x00.\x00[0-9]\x00[0-9]\x00[0-9]/ %NEWIP%/g" myfile will match an IP like 134.187.58.155 in the unicode file but how can I make sure all IPs are matched? e..g 10.22.333.4
From: Ed Morton on 15 Oct 2007 09:06 bob_smithley(a)yahoo.com wrote: > I am getting closer: > > sed -e "s/\x00[0-9]\x00[0-9]\x00[0-9]\x00\. > \x00[0-9]\x00[0-9]\x00[0-9]\x00.\x00[0-9]\x00[0-9]\x00.\x00[0-9]\x00[0-9]\x00[0-9]/ > %NEWIP%/g" myfile > > will match an IP like 134.187.58.155 in the unicode file > > but how can I make sure all IPs are matched? > > e..g 10.22.333.4 > Use an RE interval to specify 1 to 3 digits: \(\x00[0-9]\)\{1,3\}\x00. instead of exactly 3 digits: \x00[0-9]\x00[0-9]\x00[0-9]\x00. Regards, Ed.
From: bob_smithley on 15 Oct 2007 09:35 thanks for that, much appreciated :)
First
|
Prev
|
Pages: 1 2 Prev: Error with using Imagemagick convert from a shell script Next: sed replace issue |