mirror of
https://github.com/python/cpython.git
synced 2025-08-29 21:25:01 +00:00
bpo-31369: include `RegexFlag
in
re.__all__
` (GH-30279)
* added RegexFlag to re.__all__; added RegexFlag.NOFLAG Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
parent
bf95ff91f2
commit
fea7290a0e
3 changed files with 20 additions and 1 deletions
|
@ -637,6 +637,11 @@ form.
|
|||
programs that use only a few regular expressions at a time needn't worry
|
||||
about compiling regular expressions.
|
||||
|
||||
.. class:: RegexFlag
|
||||
|
||||
An :class:`enum.IntFlag` class containing the regex options listed below.
|
||||
|
||||
.. versionadded:: 3.11 - added to ``__all__``
|
||||
|
||||
.. data:: A
|
||||
ASCII
|
||||
|
@ -710,6 +715,17 @@ form.
|
|||
string and immediately before the newline (if any) at the end of the string.
|
||||
Corresponds to the inline flag ``(?m)``.
|
||||
|
||||
.. data:: NOFLAG
|
||||
|
||||
Indicates no flag being applied, the value is ``0``. This flag may be used
|
||||
as a default value for a function keyword argument or as a base value that
|
||||
will be conditionally ORed with other flags. Example of use as a default
|
||||
value::
|
||||
|
||||
def myfunc(text, flag=re.NOFLAG):
|
||||
return re.match(text, flag)
|
||||
|
||||
.. versionadded:: 3.11
|
||||
|
||||
.. data:: S
|
||||
DOTALL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue