我只想查看不带此特殊字符“,”的数字,而python中的正则表达式用逗号表示,数字如下所示:
143,000 is price
126,479,000 hours you worked
我只想看full match像这样:
143000
126479000
import re
my_text = '1,222,222 test'
my_out = re.search(r'[0-9|,]{1,}',my_text).group().replace(',','')
print(my_out)