Created
August 26, 2019 15:21
-
-
Save CodersArts/28bc79d5ac70fe0cda69728cde75021e to your computer and use it in GitHub Desktop.
compile regular expression
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 | |
pattern=re.compile('my') | |
result=pattern.findall('my name is naveen') | |
print result | |
result2=pattern.findall('Hi Hi This is codersarts') | |
print result2 | |
Output | |
['my'] | |
['Hi', 'Hi'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment