Re: [Tutor] Question on re.findall usage

2013-01-28 Thread Mitya Sirenef
On 01/28/2013 03:19 PM, Dave Wilder wrote: > On 28 January 2013 2:44, : Oscar Benjamin [mailto:oscar.j.benja...@gmail.com wrote: > > Please post in plain text (not html) as otherwise the code gets screwed up. > ... > > Some people like to use regexes for everything. I prefer to try string m

Re: [Tutor] Question on re.findall usage

2013-01-28 Thread Dave Wilder
On 28 January 2013 2:44, : Oscar Benjamin [mailto:oscar.j.benja...@gmail.com wrote: Please post in plain text (not html) as otherwise the code gets screwed up. ... Some people like to use regexes for everything. I prefer to try string methods first as I find them easier to understand. Here's

Re: [Tutor] Question on re.findall usage

2013-01-28 Thread Joel Goldstick
On Mon, Jan 28, 2013 at 2:15 PM, Dave Wilder wrote: > Hello, > > I am trying using re.findall to parse the string below and then create a > list from the results. > junk_list = 'tmsh list net interface 1.3 media-ca \rpabilities\r\nnet > interface 1.3 {\r\nmedia-capabilities {\r\nnone

Re: [Tutor] Question on re.findall usage

2013-01-28 Thread Oscar Benjamin
Please post in plain text (not html) as otherwise the code gets screwed up. When I paste your code into a terminal this is what happens: >>> junk_list = 'tmsh list net interface 1.3 media-ca \rpabilities\r\nnet >>> interface 1.3 {\r\nmedia-capabilities {\r\nnone\r\n >>> auto\r

[Tutor] Question on re.findall usage

2013-01-28 Thread Dave Wilder
Hello, I am trying using re.findall to parse the string below and then create a list from the results. junk_list = 'tmsh list net interface 1.3 media-ca \rpabilities\r\nnet interface 1.3 {\r\nmedia-capabilities {\r\nnone\r\nauto\r\n 4SR4-FD\r\n 10T-HD\r\n100