grouping in regular expressions.

gbp gpepice1 at nycap.rr.com
Fri Jul 28 22:17:12 EDT 2000


I belive there is actually a module JUST to parse out IP addresses and
related things... might what to try to find it.

kaevee at my-deja.com wrote:

> I am finding it difficult to match the ip address in the
> following line using re module.
>
> "       inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0"
>
> here is the expression I used.
>
> re.compile('\s+inet addr:(\d+\.\d+\.\d+\.\d+)\s+.*')
>
> I am not able to make out where i am making a mistake.
>
> Tons of thanks in advance,
>
> Regards,
>
> kaevee
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.




More information about the Python-list mailing list