Skip to content

Instantly share code, notes, and snippets.

@JeffersGlass
Created January 3, 2021 03:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeffersGlass/647dccbec80a470def5e6a8ef4cf3033 to your computer and use it in GitHub Desktop.
Save JeffersGlass/647dccbec80a470def5e6a8ef4cf3033 to your computer and use it in GitHub Desktop.
import re
sentence = '''Mr. Anderson and Mrs Baker were discussing
Montana when Ms. Campbell walked in with mr Davis and Mrs. Ellis."
'''
pattern = re.compile(r'')
for match in re.finditer(pattern, sentence):
print(match)
#pattern = re.compile(r'[Mm](rs|r|s)\.?\s\w+[.\s]')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment