Skip to content

Commit 94f765f

Browse files
committed
[DOC] Make clearer what will be matched with a RE
1 parent 6ad009c commit 94f765f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Doc/library/re.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ character ``'$'``.
590590
(that is, any character in Unicode character category `[Nd]`__).
591591
This includes ``[0-9]``, and also many other digit characters.
592592

593-
Matches ``[0-9]`` if the :py:const:`~re.ASCII` flag is used.
593+
Matches only ``[0-9]`` if the :py:const:`~re.ASCII` flag is used.
594594

595595
__ https://www.unicode.org/versions/Unicode15.0.0/ch04.pdf#G134153
596596

@@ -604,7 +604,7 @@ character ``'$'``.
604604
Matches any character which is not a decimal digit.
605605
This is the opposite of ``\d``.
606606

607-
Matches ``[^0-9]`` if the :py:const:`~re.ASCII` flag is used.
607+
Matches only ``[^0-9]`` if the :py:const:`~re.ASCII` flag is used.
608608

609609
.. index:: single: \s; in regular expressions
610610

@@ -615,7 +615,7 @@ character ``'$'``.
615615
non-breaking spaces mandated by typography rules in many
616616
languages).
617617

618-
Matches ``[ \t\n\r\f\v]`` if the :py:const:`~re.ASCII` flag is used.
618+
Matches only ``[ \t\n\r\f\v]`` if the :py:const:`~re.ASCII` flag is used.
619619

620620
For 8-bit (bytes) patterns:
621621
Matches characters considered whitespace in the ASCII character set;
@@ -627,7 +627,7 @@ character ``'$'``.
627627
Matches any character which is not a whitespace character. This is
628628
the opposite of ``\s``.
629629

630-
Matches ``[^ \t\n\r\f\v]`` if the :py:const:`~re.ASCII` flag is used.
630+
Matches only ``[^ \t\n\r\f\v]`` if the :py:const:`~re.ASCII` flag is used.
631631

632632
.. index:: single: \w; in regular expressions
633633

@@ -638,7 +638,7 @@ character ``'$'``.
638638
(as defined by :py:meth:`str.isalnum`),
639639
as well as the underscore (``_``).
640640

641-
Matches ``[a-zA-Z0-9_]`` if the :py:const:`~re.ASCII` flag is used.
641+
Matches only ``[a-zA-Z0-9_]`` if the :py:const:`~re.ASCII` flag is used.
642642

643643
For 8-bit (bytes) patterns:
644644
Matches characters considered alphanumeric in the ASCII character set;
@@ -654,7 +654,7 @@ character ``'$'``.
654654
By default, matches non-underscore (``_``) characters
655655
for which :py:meth:`str.isalnum` returns ``False``.
656656

657-
Matches ``[^a-zA-Z0-9_]`` if the :py:const:`~re.ASCII` flag is used.
657+
Matches only ``[^a-zA-Z0-9_]`` if the :py:const:`~re.ASCII` flag is used.
658658

659659
If the :py:const:`~re.LOCALE` flag is used,
660660
matches characters which are neither alphanumeric in the current locale

0 commit comments

Comments
 (0)