So regular expressions have been good to me so far, but now my problem is a bit trickier. The string I'm getting data from looks like this:
myString = [USELESS DATA] Request : Play [USELESS DATA] Title: Beethoven's 5th [USELESS DATA] Request : next [USELESS DATA] Title: song #2 ..... I'm using this code to search myString: .... pattern = '''(?x) Title:\s+(.+) ''' Titles = re.findall(pattern, myString) .... The problem is that I only want the "Titles" which are either: a) Followed by "Request : Play" b) Followed by "Request : next" I'm not sure if I should use RE's or some other mechanism. Thanks -- http://mail.python.org/mailman/listinfo/python-list