Wednesday, December 4, 2019

regular expression in python

re.findall(pattern,string)
re.search(pattern,string)
re.match(pattern,string)

re.search and re.match results match object
<class 're.Match'>

re.Match class have group
the finding can be calculated by group(0) and group(1) and likewise

re.Match()
-searches at start of string
if it doesn't equals it returns none object

re.findall()
-It returns list and find all matching items in string 




No comments:

Post a Comment