sub()字符串替换
>>> a = '2012-12-12 13:12'
>>> p = re.compile(r'\D')
>>> p.sub('', a)
'201212121312'
>>> help(p.sub)
Help on built-in function sub:
sub(...)
sub(repl, string[, count = 0]) --> newstring
Return the string obtained by replacing the leftmost non-overlapping
occurrences of pattern in string by the replacement repl.