Thank you. But what should I do if there are more than one hello and I only want to extract what's before the first "hello". For example, the raw string is "hi, how are you? hello I'm fine, thank you hello. that's it hello", I want to extract all the stuff before the first hello?
On 14 Aug 2005 08:02:16 -0700, Christoph Rackwitz <[EMAIL PROTECTED]> wrote: > re.findall('(.*)hello|(.*)', 'hi, how are you. hello') > re.findall('(.*)hello|(.*)', 'hi, how are you. ello') > take a look at the outputs of these. > > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list