import re ret = re.findall(r'((?<=\d)\d{4})+\b','12345678901 38473456 2305578 349579174 1786986745 18360869123') print(ret)
['8901', '3456', '5578', '9174', '6745', '9123'] #running result
import re ret = re.findall(r'((?<=\d)\d{4})+\b','12345678901 38473456 2305578 349579174 1786986745 18360869123') print(ret)
['8901', '3456', '5578', '9174', '6745', '9123'] #running result
转载于:https://www.cnblogs.com/pie-o/p/9406945.html