could ildg a écrit : > 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".
Read The Fine Manual ?-) > 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? re.findall(r'^(.*)hello', your_string_full_of_hellos) -- http://mail.python.org/mailman/listinfo/python-list