mirror of
https://github.com/python/cpython.git
synced 2025-12-11 11:31:05 +00:00
#19778: fix a couple of re reprs in the documentation.
This commit is contained in:
parent
1048fb5539
commit
613a97e193
1 changed files with 4 additions and 4 deletions
|
|
@ -271,8 +271,8 @@ performing string substitutions. ::
|
||||||
|
|
||||||
>>> import re
|
>>> import re
|
||||||
>>> p = re.compile('ab*')
|
>>> p = re.compile('ab*')
|
||||||
>>> p #doctest: +ELLIPSIS
|
>>> p
|
||||||
<_sre.SRE_Pattern object at 0x...>
|
re.compile('ab*')
|
||||||
|
|
||||||
:func:`re.compile` also accepts an optional *flags* argument, used to enable
|
:func:`re.compile` also accepts an optional *flags* argument, used to enable
|
||||||
various special features and syntax variations. We'll go over the available
|
various special features and syntax variations. We'll go over the available
|
||||||
|
|
@ -383,8 +383,8 @@ Python interpreter, import the :mod:`re` module, and compile a RE::
|
||||||
|
|
||||||
>>> import re
|
>>> import re
|
||||||
>>> p = re.compile('[a-z]+')
|
>>> p = re.compile('[a-z]+')
|
||||||
>>> p #doctest: +ELLIPSIS
|
>>> p
|
||||||
<_sre.SRE_Pattern object at 0x...>
|
re.compile('[a-z]+')
|
||||||
|
|
||||||
Now, you can try matching various strings against the RE ``[a-z]+``. An empty
|
Now, you can try matching various strings against the RE ``[a-z]+``. An empty
|
||||||
string shouldn't match at all, since ``+`` means 'one or more repetitions'.
|
string shouldn't match at all, since ``+`` means 'one or more repetitions'.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue