PaulDotCom mailing list archives

Re: Better RegEX to find IPs


From: Adrian Crenshaw <irongeek () irongeek com>
Date: Thu, 2 Dec 2010 20:09:46 -0500

Sure, thanks for looking at it. I'll attach it as a txt.
Thanks,
Adrian




On Thu, Dec 2, 2010 at 7:46 PM, Grymoire <pauldotcom () grymoire com> wrote:


Uhm, that's the one I'm already using.

Yes Adrian, I know. And the code I posted worked fine for me.
When I use it, I get

['74.125.113.27', '127.0.0.1', '127.0.0.1', '127.0.0.1', '89.216.227.38',
[snip]

So either we have different inputs, or your code is doing something
different than mine. But the problem does NOT seem to be the fault of
the regular expression. Something else is happening.

Can you post more of your code so we can see why it does not work?

BTW - if you want to clean up the output in shell, and make sure all of the
IP addresses are valid, I'd use something like

program | tr ",]['" "\n   " | sort -un |\
 awk -F. '{$1 < 256 && $2 < 256 && $3 < 256 && $4 < 256 }'


and sorry for misspelling your name.



_______________________________________________
Pauldotcom mailing list
Pauldotcom () mail pauldotcom com
http://mail.pauldotcom.com/cgi-bin/mailman/listinfo/pauldotcom
Main Web Site: http://pauldotcom.com

Attachment: dump-and-sort-i2p-router-ips.txt
Description:

_______________________________________________
Pauldotcom mailing list
Pauldotcom () mail pauldotcom com
http://mail.pauldotcom.com/cgi-bin/mailman/listinfo/pauldotcom
Main Web Site: http://pauldotcom.com

Current thread: