![]() ![]() In order to be compatible with the re module, this module has 2 behaviours: The BESTMATCH flag makes fuzzy matching search for the best match instead of the next match. The ENHANCEMATCH flag makes fuzzy matching attempt to improve the fit of the next match that it finds. If neither the ASCII, LOCALE nor UNICODE flag is specified, it will default to UNICODE if the regex pattern is a Unicode string and ASCII if it’s a bytestring. The global flags are: BESTMATCH (?b), ENHANCEMATCH (?e), POSIX (?p), REVERSE (?r), VERSION0 (?V0), VERSION1 (?V1). The scoped flags are: ASCII (?a), FULLCASE (?f), IGNORECASE (?i), LOCALE (?L), MULTILINE (?m), DOTALL (?s), UNICODE (?u), VERBOSE (?x), WORD (?w). Scoped flags can apply to only part of a pattern and can be turned on or off global flags apply to the entire pattern and can only be turned on. There are 2 kinds of flag: scoped and global. ![]() The behaviour is undefined if the string changes during matching, so use it only when it is guaranteed that that won’t happen. It is also possible to force the regex module to release the GIL during matching by calling the matching methods with the keyword argument concurrent=True. ![]() The regex module releases the GIL during matching on instances of the built-in (immutable) string classes, enabling other Python threads to run concurrently. ![]() It expects that all codepoints are the same width, so it won’t behave properly with PyPy outside U+0000.U+007F because PyPy stores strings as UTF-8. The re module’s behaviour with zero-width matches changed in Python 3.7, and this module follows that behaviour when compiled for Python 3.7. This regex implementation is backwards-compatible with the standard ‘re’ module, but offers additional functionality. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |