正则表达式统计字符串中数字的个数

#coding=utf-8
import string
import re
str='i have 300 yuan, you 234 234 give me 200 again, then i have 500 yuan'
iList= re.findall(r"d+",str)
print "string:",str
print "total digit number:",len(iList)

原文地址:https://www.cnblogs.com/xiaxiaoxu/p/8727910.html