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

#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)

 

 

posted @ 2018-04-06 15:42  夏晓旭  阅读(5176)  评论(0编辑  收藏  举报