From: bob_smithley on
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
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
thanks for that, much appreciated :)