-
exception
re.
error
( msg, pattern=None, pos=None ) -
Exception raised when a string passed to one of the functions here is not a valid regular expression (for example, it might contain unmatched parentheses) or when some other error occurs during compilation or matching. It is never an error if a string contains no match for a pattern. The error instance has the following additional attributes:
翻译:当传入的RE表达式对于这个方法不合法时,就会抛出异常(比如,不匹配的括号)或者是在编译和匹配是遇到的异常。如果遇到源串没有匹配RE表达式,这种不算错误。ERROR实例拥有以下属性-
pattern
¶ -
The regular expression pattern.
Changed in version 3.5: Added additional attributes.
-
-
-
python学习之re 20 purge() exception
猜你喜欢
转载自blog.csdn.net/rubikchen/article/details/80509263
今日推荐
周排行