用python正则表达式表达40010 500 0和5022 0 0
import re
匹配连续的数字
pattern = r'\d+' text = '40010 500 0 5022 0 0' result = re.findall(pattern, text) print(result) # ['40010', '500', '0', '5022', '0', '0']
原文地址: http://www.cveoy.top/t/topic/izuB 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
import re
pattern = r'\d+' text = '40010 500 0 5022 0 0' result = re.findall(pattern, text) print(result) # ['40010', '500', '0', '5022', '0', '0']
原文地址: http://www.cveoy.top/t/topic/izuB 著作权归作者所有。请勿转载和采集!