summaryrefslogtreecommitdiff
path: root/Doc/library/string.rst
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2017-11-21 10:28:13 -0500
committerGitHub <noreply@github.com>2017-11-21 10:28:13 -0500
commite256b408889eba867e1d90e5e1a0904843256255 (patch)
tree3bbec9153c33ddd4eb95ceb19ae3b244e9490438 /Doc/library/string.rst
parent337cbbace0a43f50fcd33ea4d3b7cb30733237db (diff)
downloadcpython-git-e256b408889eba867e1d90e5e1a0904843256255.tar.gz
bpo-31672 - Add one last minor clarification for idpattern (#4483)
Add one last minor clarification for idpattern
Diffstat (limited to 'Doc/library/string.rst')
-rw-r--r--Doc/library/string.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index 5b25428525..e9606783ef 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -755,13 +755,15 @@ attributes:
* *idpattern* -- This is the regular expression describing the pattern for
non-braced placeholders. The default value is the regular expression
- ``(?-i:[_a-zA-Z][_a-zA-Z0-9]*)``. If this is given and *braceidpattern* is
+ ``(?a:[_a-zA-Z][_a-zA-Z0-9]*)``. If this is given and *braceidpattern* is
``None`` this pattern will also apply to braced placeholders.
.. note::
Since default *flags* is ``re.IGNORECASE``, pattern ``[a-z]`` can match
- with some non-ASCII characters. That's why we use local ``-i`` flag here.
+ with some non-ASCII characters. That's why we use the local ``a`` flag
+ here. Further, with the default *flags* value, including ``A-Z`` in the
+ ranges is redundant, but required for backward compatibility.
While *flags* is kept to ``re.IGNORECASE`` for backward compatibility,
you can override it to ``0`` or ``re.IGNORECASE | re.ASCII`` when