python使用re正则进行匹配分割
字符串分隔
http://www.nowcoder.com/questionTerminal/d9162298cb5a437aad722fccccaae8a7
import re
while True:
try:
a=input()
a1=str(a)
a2=a1
if len(a1)<=8:
for x in range(8-len(a1)):
a2=a1+'0'
a1=a2
a3=a2
print(a3)
else:
i=len(a1)%8
if i!=0:
for x in range(8-i):
a2=a1+'0'
a1=a2
a3 = re.findall(r".{8}", a2)
# print(a3 )
for i in a3:
print (i)
except:
break