标签:
例一:匹配长度为1-15的域名
#-*-encoding:utf-8-*- import re regex=re.compile(‘^www[.][a-z]{1,15}[.](com|org)‘) m1=re.match(regex, ‘www.baidu.com‘) #m2=re.match(regex, ‘abcdefghig‘) if m1 is not None: print ‘true1‘ #if m2 is not None: # print ‘true2‘
标签:
原文地址:http://www.cnblogs.com/bluewelkin/p/4349559.html