Skip to content

Instantly share code, notes, and snippets.

@kidig kidig/matching line.py
Last active Aug 29, 2015

Embed
What would you like to do?
# n) Something text or
# n) Right text*
match = re.match(r'^\w\)\s+(.[^\*]*)(\*?)$', line, re.UNICODE)
if match and len(match.groups()):
answer = dict(zip(['text','right'], [x for x in match.groups() if len(x)]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.