summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorandrei kulakov <andrei.avk@gmail.com>2022-02-05 03:54:28 (GMT)
committerGitHub <noreply@github.com>2022-02-05 03:54:28 (GMT)
commitfea7290a0ecee09bbce571d4d10f5881b7ea3485 (patch)
tree463766aa964faf353c68e991c0567da5852d66dd /Doc
parentbf95ff91f2c1fc5a57190491f9ccdc63458b089e (diff)
downloadcpython-fea7290a0ecee09bbce571d4d10f5881b7ea3485.zip
cpython-fea7290a0ecee09bbce571d4d10f5881b7ea3485.tar.gz
cpython-fea7290a0ecee09bbce571d4d10f5881b7ea3485.tar.bz2
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>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/re.rst16
1 files changed, 16 insertions, 0 deletions
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index b12ce4b..8d62e3b 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -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