Robert Dodier wrote: > I've decided it's easier for me just to search for FOO, and then > break up the string based on the locations of FOO. > > But I'd like to better understand regular expressions.
Those who cannot learn regular expressions are doomed to repeat string searches. Which is not such a bad thing. txt = "blah FOO blah1a blah1b FOO blah2 FOO blah3a blah3b blah3b" def fa(s, pat): retlist = [] try: while True: i = s.rindex(pat) retlist.insert(0,s[i:]) s = s[:i] except: return retlist print fa(txt, "FOO") -- http://mail.python.org/mailman/listinfo/python-list