summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/string.rst13
1 files changed, 11 insertions, 2 deletions
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index 1a9b630..1076cdb 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -755,8 +755,17 @@ attributes:
* *idpattern* -- This is the regular expression describing the pattern for
non-braced placeholders. The default value is the regular expression
- ``[_a-z][_a-z0-9]*``. If this is given and *braceidpattern* is ``None``
- this pattern will also apply to braced placeholders.
+ ``(?-i:[_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.
+
+ While *flags* is kept to ``re.IGNORECASE`` for backward compatibility,
+ you can override it to ``0`` or ``re.IGNORECASE | re.ASCII`` when
+ subclassing. It's simple way to avoid unexpected match like above example.
.. versionchanged:: 3.7
*braceidpattern* can be used to define separate patterns used inside and