#!/usr/bin/python
# -*- coding: UTF-8 -*-
import re
phone = "aaa bbb ccc AAA BBB CCC"
g = re.compile(r'([a-z]+)',re.I)#生成用来提取字母正则表达式对象 re.I忽略大小写
temp = g.findall(phone)
temp.reverse()#倒序排列
string = ''
for b in range(len(temp)):
string = string + ' ' + temp[b]
print string
网友评论