Tcl's list search command has the option to search for a list element that
matches a given regex. Is there something similar in python? If not, it seems
like it should be fairly trivial for me to write my own (just wondering if I
would be re-inventing the wheel).
On Mon, Jan 31, 2011 at 7:07 AM, Elwin Estle chrysalis_reb...@yahoo.comwrote:
Tcl's list search command has the option to search for a list element that
matches a given regex. Is there something similar in python? If not, it
seems like it should be fairly trivial for me to write my own (just
--- On Mon, 1/31/11, Wayne Werner waynejwer...@gmail.com wrote:
From: Wayne Werner waynejwer...@gmail.com
Subject: Re: [Tutor] search list with regex
To: Elwin Estle chrysalis_reb...@yahoo.com
Cc: tutor@python.org
Date: Monday, January 31, 2011, 10:20 AM
On Mon, Jan 31, 2011 at 7:07 AM, Elwin
Elwin Estle chrysalis_reb...@yahoo.com wrote
parse various text files and my standard method is to
slurp the whole thing up into a string variable, then
break it up into a list that I can then work on
If you read it with readlines() Python will do all of
that for you...
HTH,
--
Alan Gauld
--- On Mon, 1/31/11, Alan Gauld alan.ga...@btinternet.com wrote:
From: Alan Gauld alan.ga...@btinternet.com
Subject: Re: [Tutor] search list with regex
To: tutor@python.org
Date: Monday, January 31, 2011, 3:29 PM
Elwin Estle chrysalis_reb...@yahoo.com
wrote
parse various text files
Alan Gauld wrote:
Elwin Estle chrysalis_reb...@yahoo.com wrote
parse various text files and my standard method is to
slurp the whole thing up into a string variable, then
break it up into a list that I can then work on
If you read it with readlines() Python will do all of
that for you...
Elwin Estle wrote:
Tcl's list search command has the option to search for a list element
that matches a given regex. Is there something similar in python?
Not using regexes.
If not, it seems like it should be fairly trivial for me to write my
own (just wondering if I would be re-inventing