Re: Python 3 regex woes (parsing ISC DHCPD config)

2015-01-13 Thread Thomas 'PointedEars' Lahn
Jason Bailey wrote: My script first reads the DHCPD configuration file into memory - variable filebody. It then utilizes the re module to find the configuration details for the wanted shared network. The config file might look something like this: ##

Re: Python 3 regex woes (parsing ISC DHCPD config)

2015-01-13 Thread Thomas 'PointedEars' Lahn
Thomas 'PointedEars' Lahn wrote: Jason Bailey wrote: shared-network My-Network-MOHE { […] { I compile my regex: m = re.compile(r^(shared\-network ( + re.escape(shared_network) + r) \{((\n|.|\r\n)*?)(^\})), re.MULTILINE|re.UNICODE) This code does not run as posted. Applying Occam’s

Re: Python 3 regex woes (parsing ISC DHCPD config)

2015-01-12 Thread Dave Angel
On 01/12/2015 01:20 PM, Jason Bailey wrote: Hi all, What changed between 1:03 and 1:20 that made you post a nearly identical second message, as a new thread? Unfortunately, I get no matches. From output on the command line, I can see that Python is adding extra backslashes to my

Re: Python 3 regex woes (parsing ISC DHCPD config)

2015-01-12 Thread Albert-Jan Roskam
- Original Message - From: Jason Bailey jbai...@emerytelcom.com To: python-list@python.org Cc: Sent: Monday, January 12, 2015 7:20 PM Subject: Python 3 regex woes (parsing ISC DHCPD config) Hi all, I'm working on a Python _3_ project that will be used to parse ISC DHCPD

Python 3 regex woes (parsing ISC DHCPD config)

2015-01-12 Thread Jason Bailey
Hi all, I'm working on a Python _3_ project that will be used to parse ISC DHCPD configuration files for statistics and alarming purposes (IP address pools, etc). Anyway, I'm hung up on this one section and was hoping someone could provide me with some insight. My script first reads the