HypoNt: I need to turn a human-readable list into a list():
print re.search(r'(?:(\w+), |and (\w+))+', 'whatever a, bbb, and c').groups() That currently returns ('c',). I'm trying to match "any word \w+ followed by a comma, or a final word preceded by and." The match returns 'a, bbb, and c', but the groups return ('bbb', 'c'). What do I type for .groups() to also get the 'a'? Please go easy on me (and no RTFM!), because I have only been using regular expressions for about 20 years... -- Phlip http://bit.ly/ZeekLand -- http://mail.python.org/mailman/listinfo/python-list