Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python RegEx Compile – re.compile()

# Module Regular Expression is imported
import re

# compile() creates regular expression character class [a-d], which is equivalent to [abcd].
# class [abcd] will match with string with 'a', 'b', 'c', 'd'.
p = re.compile('[a-e]')

# findall() searches for the Regular Expression nd return a list upon finding
print(p.findall("Hello, Welcome to Softhunt.net Tutorial Website"))
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Python #RegEx #Compile
ADD COMMENT
Topic
Name
4+5 =