表示字符 示例1: . #coding=utf-8 import re ret = re.match(".","a") ret.group() ret = re.match(".","b") ret.group() ret = re.match(".","M") ret.group() 示例2:[ ] #coding=utf-8 import re # 如果hello的首字符小写,那么正…
关于前向,后向,匹配,非匹配 Matches if ... matches next, but doesn’t consume any of the string. This is called a lookahead assertion. For example, Isaac (?=Asimov) will match 'Isaac ' only if it’s followed by 'Asimov'.(?!...)Matches if ... doesn’t match next. Thi…