[Tutor] Parse multi line with re module.

Ganesh Kumar bugcy013 at gmail.com
Tue Jan 3 15:13:29 CET 2012


Hi Guys,

I want parse multiple line. with re.module, this is my given string
http://dpaste.com/680760/ I have try with re.compile module. I want parse
two line mac address and channel,
I have done with for mac address finding

r = re.compile("^Searching for OPUSH on (\w\w(:\w\w)+)")

for channel finding

device_r = re.compile("^Channel: (\d+)")

the two parsing string working. but I want combine two pattern in to one.

This is my code
http://www.bpaste.net/show/21323/

please guide me .


-Ganesh

Did I learn something today? If not, I wasted it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120103/35ac7f3c/attachment.html>


More information about the Tutor mailing list