Re: finding the list of the matched strings

2006-11-05 Thread John Machin
James Stroud wrote: [snip] > I think I'm having some network problems. I'll try again. Also the > previous "attempt" had a typo (perhaps a freudian slip). Also this time you replied to the wrong thread :-) > > ",".join(some_list). > > By the way, don't name your own objects with the names of bui

Re: finding the list of the matched strings

2006-11-05 Thread Peter Otten
[EMAIL PROTECTED] wrote: > Hi, I have a list of strings. And I want to find the subset which > matches a particular regular expression. > > import re > ll = ('a', 'b', 's1', 's2', '3s') > p = re.compile('^s.*') > newList = filter(lambda s: p.match(s), ll) or newList = [s for s in ll if p.match(

Re: finding the list of the matched strings

2006-11-05 Thread Gerard Flanagan
[EMAIL PROTECTED] wrote: > Hi, I have a list of strings. And I want to find the subset which > matches a particular regular expression. > > import re > ll = ('a', 'b', 's1', 's2', '3s') > p = re.compile('^s.*') > newList = filter(lambda s: p.match(s), ll) > > I suppose there should be simple funct

Re: finding the list of the matched strings

2006-11-05 Thread James Stroud
[EMAIL PROTECTED] wrote: > Hi, I have a list of strings. And I want to find the subset which > matches a particular regular expression. > > import re > ll = ('a', 'b', 's1', 's2', '3s') > p = re.compile('^s.*') > newList = filter(lambda s: p.match(s), ll) > > I suppose there should be simple func

Re: finding the list of the matched strings

2006-11-05 Thread Christian Joergensen
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Hi, I have a list of strings. And I want to find the subset which > matches a particular regular expression. > > import re > ll = ('a', 'b', 's1', 's2', '3s') > p = re.compile('^s.*') > newList = filter(lambda s: p.match(s), ll) > > I suppose there