Repetition, Special Characters, and Grouping : Match : Regular Expressions PYTHON TUTORIALS


PYTHON TUTORIALS » Regular Expressions » Match »

 

Repetition, Special Characters, and Grouping


import re

patt = 'w+@(w+.)?w+.com'
re.match(patt, 'nobody@xxx.com').group()
re.match(patt, 'nobody@www.xxx.com').group()
patt = 'w+@(w+.)*w+.com'
re.match(patt, 'nobody@www.xxx.yyy.zzz.com').group()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Regular Expressions
» Match