Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def doAction(str2):
words = str2.split()
if words[0] == 'set':
a = re.compile(' set an alarm for (\w+ \w*) (am|pm)')
m = a.match(str2)
if m:
print(m.group(1), m.group(2))
setAlarm(m.group(1), m.group(2))
else:
print(str2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment