网站首页 > 精选文章 / 正文
分享兴趣,传播快乐,增长见闻,留下美好!亲爱的您,这里是LearningYard学苑。欢迎大家继续访问学苑内容,今天小编为大家带来有关Python的知识。
Share interest, spread happiness, increase knowledge, leave a good! Dear you, here is the LearningYard Academy. Welcome to continue to visit the content of the academy, today xiaobian to bring you knowledge about Python management
(1)最简单的正则表达式是普通字符事,只能西配自身。
(2)'[pjc]ython'可以四配'python',jython',cython'
(3)[a-zA-Z0-9]'可以西配一个任意大小写字用或数字。(4)'[^abe]可以一个四配任意除'a'、'b'、'c'之外的字符。
(5)'pythonlperl'或'p(ython|erl)'都可以匹配'python'或'perl'。
(6)r'(http://)? (wwwl.)? python\.org'只他 匹配http://www.python.org"http://python.org'、www,python.org和'python.org’.
(7)'*http'只能四配所有以'http‘开头的字符串。
(8)(pattern)*:允许模式重复0次或多次。
(9)(pattern)+:允许模式重复一次或多次。
(10)(pattern)(m,n}:允许模式重复m~n次,注意逗号后面不要有空格。
(11)'(alb)*c':匹配多个(包含0个)a或b,后面紧跟一个字母 c。
(12)’abl1,)':等价于'ab+',匹配以字母a开头后面紧跟一个或多个字母b的字符串。
(13)‘^[a-zA-Z]{1)([a-zA-Z0-9,_])(4,19}