@@ -501,6 +501,8 @@ The special characters are:
501501 in the ASCII range (``b'\x00' ``-``b'\x7f' ``).
502502
503503
504+ .. _re-special-sequences :
505+
504506The special sequences consist of ``'\' `` and a character from the list below.
505507If the ordinary character is not an ASCII digit or an ASCII letter, then the
506508resulting RE will match the second character. For example, ``\$ `` matches the
@@ -779,6 +781,17 @@ Flags
779781 Corresponds to the inline flag ``(?s) ``.
780782
781783
784+ .. data :: U
785+ UNICODE
786+
787+ In Python 2, this flag made :ref: `special sequences <re-special-sequences >`
788+ include Unicode characters in matches. Since Python 3, Unicode characters
789+ are matched by default.
790+
791+ See :const: `A ` for restricting matching on ASCII characters instead.
792+
793+ This flag is only kept for backward compatibility.
794+
782795.. data :: X
783796 VERBOSE
784797
@@ -1520,14 +1533,14 @@ Simulating scanf()
15201533
15211534.. index :: single: scanf()
15221535
1523- Python does not currently have an equivalent to :c:func: `scanf `. Regular
1536+ Python does not currently have an equivalent to :c:func: `! scanf `. Regular
15241537expressions are generally more powerful, though also more verbose, than
1525- :c:func: `scanf ` format strings. The table below offers some more-or-less
1526- equivalent mappings between :c:func: `scanf ` format tokens and regular
1538+ :c:func: `! scanf ` format strings. The table below offers some more-or-less
1539+ equivalent mappings between :c:func: `! scanf ` format tokens and regular
15271540expressions.
15281541
15291542+--------------------------------+---------------------------------------------+
1530- | :c:func: `scanf ` Token | Regular Expression |
1543+ | :c:func: `! scanf ` Token | Regular Expression |
15311544+================================+=============================================+
15321545| ``%c `` | ``. `` |
15331546+--------------------------------+---------------------------------------------+
@@ -1552,7 +1565,7 @@ To extract the filename and numbers from a string like ::
15521565
15531566 /usr/sbin/sendmail - 0 errors, 4 warnings
15541567
1555- you would use a :c:func: `scanf ` format like ::
1568+ you would use a :c:func: `! scanf ` format like ::
15561569
15571570 %s - %d errors, %d warnings
15581571
0 commit comments