Skip to content

Commit

Permalink
Docs: add a 'also' for $ special character and RE examples reference …
Browse files Browse the repository at this point in the history
…labels
  • Loading branch information
adorilson committed Oct 3, 2024
1 parent 643070c commit 17baf98
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Doc/library/re.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ The special characters are:
matches both ``'foo'`` and ``'foobar'``, while the regular expression ``foo$``
matches
only ``'foo'``. More interestingly, searching for ``foo.$`` in ``'foo1\nfoo2\n'``
matches ``'foo2'`` normally, but ``'foo1'`` in :const:`MULTILINE` mode; searching
matches ``'foo2'`` normally, but also ``'foo1'`` in :const:`MULTILINE` mode; searching
for
a single ``$`` in ``'foo\n'`` will find two (empty) matches: one just before
the newline, and one at the end of the string.
Expand Down Expand Up @@ -1601,6 +1601,8 @@ Regular Expression Examples
---------------------------


.. _checking-for-a-pair:

Checking for a Pair
^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -1655,6 +1657,8 @@ To find out what card the pair consists of, one could use the
'a'


.. _simulating-scanf:

Simulating scanf()
^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -1742,6 +1746,8 @@ beginning with ``'^'`` will match at the beginning of each line. ::
<re.Match object; span=(4, 5), match='X'>


.. _making-a-phonebook:

Making a Phonebook
^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -1803,6 +1809,8 @@ house number from the street name:
['Heather', 'Albrecht', '548.326.4584', '919', 'Park Place']]


.. _text-munging:

Text Munging
^^^^^^^^^^^^

Expand All @@ -1823,6 +1831,8 @@ in each word of a sentence except for the first and last characters::
'Pofsroser Aodlambelk, plasee reoprt yuor asnebces potlmrpy.'


.. _finding-all-adverbs:

Finding all Adverbs
^^^^^^^^^^^^^^^^^^^

Expand All @@ -1836,6 +1846,8 @@ the following manner::
['carefully', 'quickly']


.. _finding-all-adverbs-and-their-positions:

Finding all Adverbs and their Positions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand All @@ -1852,6 +1864,8 @@ to find all of the adverbs *and their positions* in some text, they would use
40-47: quickly


.. _raw-string-notation:

Raw String Notation
^^^^^^^^^^^^^^^^^^^

Expand All @@ -1876,6 +1890,8 @@ functionally identical::
<re.Match object; span=(0, 1), match='\\'>


.. _writing-a-tokenizer:

Writing a Tokenizer
^^^^^^^^^^^^^^^^^^^

Expand Down

0 comments on commit 17baf98

Please sign in to comment.