[Tutor] re.compile concatenating two searh words

2008-09-29 Thread Srinivas Iyyer
Hi Tutors, I have a list with elements as strings. I want to search if any of these element strings has two words of my interest. How can I ask re.compile to look for both words. my words are 'good' and 'bad'. import re pat = re.compile('good'+'bad') a = ['Rama is a good boy','Raghu is a

Re: [Tutor] re.compile concatenating two searh words

2008-09-29 Thread Steve Willoughby
On Mon, Sep 29, 2008 at 03:19:02PM -0700, Srinivas Iyyer wrote: Hi Tutors, I have a list with elements as strings. I want to search if any of these element strings has two words of my interest. How can I ask re.compile to look for both words. my words are 'good' and 'bad'. import re

Re: [Tutor] re.compile concatenating two searh words

2008-09-29 Thread Jerry Hill
On Mon, Sep 29, 2008 at 6:19 PM, Srinivas Iyyer [EMAIL PROTECTED] wrote: Hi Tutors, I have a list with elements as strings. I want to search if any of these element strings has two words of my interest. How can I ask re.compile to look for both words. my words are 'good' and 'bad'. If