Re: help with pyparsing

2007-12-10 Thread Prabhu Gurumurthy
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paul McGuire wrote: > On Dec 9, 11:01 pm, Prabhu Gurumurthy <[EMAIL PROTECTED]> wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> All, >> >> I have the following lines that I would like to

help with pyparsing

2007-12-09 Thread Prabhu Gurumurthy
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 All, I have the following lines that I would like to parse in python using pyparsing, but have some problems forming the grammar. Line in file: table const { 207.135.103.128/26, 207.135.112.64/29 } table persist { ! 10.200.2/24, 10.200/22 } table

help parsing ipv6 addresses and subnets

2007-11-07 Thread Prabhu Gurumurthy
Hello list, I would like to parse IPv6 addresses and subnet using re module in python. I am able to either parse the ipv6 address or ipv6 network but not both using single line. any help appreciated. BTW is there a metacharacter for hex digits. Thanks Prabhu - ---

Question on regex

2006-12-23 Thread Prabhu Gurumurthy
Hello all - I have a file which has IP address and subnet number and I use regex to extract the IP separately from subnet. pattern used for IP: \d{1,3}(\.\d{1,3}){3} pattern used for subnet:((\d{1,3})|(\d{1,3}(\.\d{1,3}){1,3}))/(\d{1,2}) so I have list of ip/subnets strewn around like this 1

Question regarding lists and regex

2006-11-08 Thread Prabhu Gurumurthy
Here is a simple program, which queries /var/log/daemon on my OpenBSD box and gets the list of valid ntp peers. Questions: what is the easiest way for me to create lists on the fly, by that I mean like perl push my @foo, something_from_say_stderr. The reason is as you can ip = [""] statement b