![]() ![]() match ( regex_str, string ) ¶Ĭompile regex_str and match against string. compile ( regex_str ) ¶Ĭompile regular expression, return regex object. split ( "line1 \r line2 \n line3 \r\n " ) # Result: # Functions ¶ re. Import re # As re doesn't support escapes itself, use of r"" strings is not # recommended. Special character escapes like \r, \n - use Python’s own escaping For example, r"\r\n" when used as the regularĮxpression is equivalent to "rn". Not recommended to use raw Python strings ( r"") for regularĮxpressions. ![]() are not handled specially, and will beĮquivalent to literal letters r, n, etc. For example, \* isĮquivalent to literal * (not treated as the * operator). Any other character following the backslash, exceptįor those listed above, is taken literally. Matches non “word characters” (ASCII only). Each group is capturing (a substring it captures can be accessed Match either the left-hand side or the right-hand side sub-patterns of Non-greedy version of , match one or more, with the preference Non-greedy version of *, match zero or more, with the preference Non-greedy version of ?, match zero or one, with the preference Match one or more of the previous sub-pattern. Match zero or more of the previous sub-pattern. Match zero or one of the previous sub-pattern. Individual characters and ranges are supported, Supported operators and special sequences are. Syntax supported is a subset of CPython re module (and actually isĪ subset of POSIX extended regular expressions). ![]() ![]() This module implements regular expression operations. For more information, refer to the original This module implements a subset of the corresponding CPython module,Īs described below.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |