Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python RegEx re.compile()

import re

# w is equivalent to [a-zA-Z0-9_].
p = re.compile('w')
print(p.findall("He said * in some_lang."))

# w+ matches to group of alphanumeric character.
p = re.compile('w+')
print(p.findall("I went to him at 9 A.M., he 
said *** in some_language."))

# W matches to non alphanumeric characters.
p = re.compile('W')
print(p.findall("he said *** in some_language."))
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Python #RegEx
ADD COMMENT
Topic
Name
8+4 =