summaryrefslogtreecommitdiffstats
path: root/Doc/library/re.rst
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-01-13 00:30:00 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-01-13 00:30:00 (GMT)
commitfae34df767b9d76b2a8888070364bcbd0b05535b (patch)
tree80bf43667bb060b09a1d3a9e66de40245f908e8f /Doc/library/re.rst
parent466725136d7aee2c0e09834e5ed802e69860e035 (diff)
downloadcpython-fae34df767b9d76b2a8888070364bcbd0b05535b.zip
cpython-fae34df767b9d76b2a8888070364bcbd0b05535b.tar.gz
cpython-fae34df767b9d76b2a8888070364bcbd0b05535b.tar.bz2
Merged revisions 77457 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r77457 | ezio.melotti | 2010-01-13 02:28:37 +0200 (Wed, 13 Jan 2010) | 9 lines Merged revisions 77455 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r77455 | ezio.melotti | 2010-01-13 02:25:03 +0200 (Wed, 13 Jan 2010) | 1 line #7685: typo ........ ................
Diffstat (limited to 'Doc/library/re.rst')
-rw-r--r--Doc/library/re.rst10
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index 4f1528d..af11501 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -849,16 +849,16 @@ support the following methods and attributes:
A moderately complicated example:
- >>> m = re.match(r"(?P<first_name>\w+) (?P<last_name>\w+)", "Malcom Reynolds")
+ >>> m = re.match(r"(?P<first_name>\w+) (?P<last_name>\w+)", "Malcolm Reynolds")
>>> m.group('first_name')
- 'Malcom'
+ 'Malcolm'
>>> m.group('last_name')
'Reynolds'
Named groups can also be referred to by their index:
>>> m.group(1)
- 'Malcom'
+ 'Malcolm'
>>> m.group(2)
'Reynolds'
@@ -898,9 +898,9 @@ support the following methods and attributes:
the subgroup name. The *default* argument is used for groups that did not
participate in the match; it defaults to ``None``. For example:
- >>> m = re.match(r"(?P<first_name>\w+) (?P<last_name>\w+)", "Malcom Reynolds")
+ >>> m = re.match(r"(?P<first_name>\w+) (?P<last_name>\w+)", "Malcolm Reynolds")
>>> m.groupdict()
- {'first_name': 'Malcom', 'last_name': 'Reynolds'}
+ {'first_name': 'Malcolm', 'last_name': 'Reynolds'}
.. method:: MatchObject.start([group])