数字的正则表达式,python
发布时间:2020-12-14 04:22:42 所属栏目:百科 来源:网络整理
导读:a = "123456-" b = "-22222222221.212345678975" c = "4.773-101" import re #美元符号,匹配一个字符串的结尾或者字符串最后面的换行符 #print "a",re.match(r"d+$",a) and True or False #print "b",re.match(r"d+.$",b) and True or False print "b",re
a = "123456-" b = "-22222222221.212345678975" c = "4.773-101" import re #美元符号,匹配一个字符串的结尾或者字符串最后面的换行符 #print "a",re.match(r"d+$",a) and True or False #print "b",re.match(r"d+.$",b) and True or False print "b",re.match(r"-?d*.?d*(e-d+)?d$",b) and True or False print "a",a) and True or False print "c",c) and True or False (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |