python re.sub
- 经常遇到使用re.sub的情况,但经常忘记,所以记录一下
- 首先还是看看大神的简介:crifan【整理】详解Python中re.sub
sub(pattern, repl, string, count=0, flags=0)
Return the string obtained by replacing the leftmost
non-overlapping occurrences of the pattern in string by the
replacement repl. repl can be either a string or a callable;
if a string, backslash escapes ...