<reponame>tchakravarty/PythonExamples
import re
import keyword

r1 = '[bh]+[aiu]+t'
print(re.findall(r1, "hut"))

r2 = "\w+\s\w+"
print(re.findall(r2, "<NAME>"))

r3 = "\w+,\s\w"
print(re.findall(r3, 'Chakravarty, T'))

# whether Python identifier
r4 = ('|').join(keyword.kwlist)
print(re.findall(r4, "del"))

# match street addresses
r5 = '\d+\s[\w+\s]+'
print(re.findall(r5, "9800 de la Soul Boulevard"))

#
import re
import keyword

r1 = '[bh]+[aiu]+t'
print(re.findall(r1, "hut"))

r2 = "\w+\s\w+"
print(re.findall(r2, "<NAME>"))

r3 = "\w+,\s\w"
print(re.findall(r3, 'Chakravarty, T'))

# whether Python identifier
r4 = ('|').join(keyword.kwlist)
print(re.findall(r4, "del"))

# match street addresses
r5 = '\d+\s[\w+\s]+'
print(re.findall(r5, "9800 de la Soul Boulevard"))

#
# whether Python identifier # match street addresses #