如果我有以下字符串“some numbers 66666666666666666667867866 and serial 151283917503423 and 8888888”,我想找到15位数字(只有151283917503423),如何使它不匹配更大的数字,并处理字符串可能只是“151283917503423”的可能性,因此我不能通过它可能包含两侧的空格来识别它?
serial = re.compile('[0-9]{15}')
serial.findall('some numbers 66666666666666666667867866 and serial 151283917503423 and 8888888')
这个返回了66666666666666666667867866和151283917503423,但我只想要后者。