-
-
Save JeffersGlass/477214b7e01a578392592db527ccd6ef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
#Special chars: () [] {} \ | . * + ? ^ | |
sentence = '''Sometimes, it is useful to find not just the | |
first match in a sentence, but every match; the findIter() | |
method returns an iterator containing every valid match.''' | |
pattern = re.compile(r'findIter()') | |
for match in re.finditer(pattern, sentence): | |
print(match) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment