import re input = "bunch(oranges, bananas, apples)" var1, var2, var3 = re.match('bunch\((\w+), (\w+), (\w+)\)', input).group(1, 2, 3)
from : https://stackoverflow.com/questions/13444675/python-re-storing-multiple-matches-in-variables
No comments:
Post a Comment