summaryrefslogtreecommitdiffstats
path: root/Doc/howto/regex.rst
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-11-25 20:47:01 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-11-25 20:47:01 (GMT)
commit613a97e193466d70904e767b354e29edfd1be0c3 (patch)
tree3e781f563c775e7009b8cef787f691f432c0d962 /Doc/howto/regex.rst
parent1048fb55398e0a01400ed9ba4b75c74fe4ba6ede (diff)
downloadcpython-613a97e193466d70904e767b354e29edfd1be0c3.zip
cpython-613a97e193466d70904e767b354e29edfd1be0c3.tar.gz
cpython-613a97e193466d70904e767b354e29edfd1be0c3.tar.bz2
#19778: fix a couple of re reprs in the documentation.
Diffstat (limited to 'Doc/howto/regex.rst')
-rw-r--r--Doc/howto/regex.rst8
1 files changed, 4 insertions, 4 deletions
diff --git a/Doc/howto/regex.rst b/Doc/howto/regex.rst
index 8a089e4..fbe763b 100644
--- a/Doc/howto/regex.rst
+++ b/Doc/howto/regex.rst
@@ -271,8 +271,8 @@ performing string substitutions. ::
>>> import re
>>> p = re.compile('ab*')
- >>> p #doctest: +ELLIPSIS
- <_sre.SRE_Pattern object at 0x...>
+ >>> p
+ re.compile('ab*')
:func:`re.compile` also accepts an optional *flags* argument, used to enable
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
>>> p = re.compile('[a-z]+')
- >>> p #doctest: +ELLIPSIS
- <_sre.SRE_Pattern object at 0x...>
+ >>> p
+ re.compile('[a-z]+')
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'.