finditer(pattern, string, flags=0) 返回包含所有匹配项的迭代对象,其中每个匹配项都是match对象
fullmatch(pattern, string, flags=...search(pattern, string[, flags]) 在整个字符串中寻找模式,返回match对象或None
split(pattern, string[, maxsplit=0]) 根据模式匹配项分隔字符串...sub(pat, repl, string[, count=0]) 将字符串中所有pat的匹配项用repl替换,返回新字符串,repl可以是字符串或返回字符串的可调用对象,该可调用对象作用于每个匹配的...match对象
subn(pat, repl, string[, count=0]) 将字符串中所有pat的匹配项用repl替换,返回包含新字符串和替换次数的二元元组,repl可以是字符串或返回字符串的可调用对象...\d+', 'Python 2.7.13') #查找并返回x.x.x形式的数字
['2.7.13']
>>> re.findall('\d+\.\d+\.