Skip to content

Instantly share code, notes, and snippets.

@JoMingyu
Created April 9, 2018 11:11
import re
regex = re.compile('(?P<first_name>\w+) (?P<last_name>\w+)')
m = regex.match('Isaac Newton')
print(m[0])
# 'Isaac Newton'
print(m[1])
# 'Isaac'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment