summaryrefslogtreecommitdiffstats
path: root/Doc/library/re.rst
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-12-31 16:14:33 (GMT)
committerChristian Heimes <christian@cheimes.de>2007-12-31 16:14:33 (GMT)
commit5b5e81c637eb115b27b4c5c66cf1cf348c706162 (patch)
treee83d0ce68e92750e40fbb901a0659bade6f41674 /Doc/library/re.rst
parent862543aa85249b46649b60da96743b4b14c6c83b (diff)
downloadcpython-5b5e81c637eb115b27b4c5c66cf1cf348c706162.zip
cpython-5b5e81c637eb115b27b4c5c66cf1cf348c706162.tar.gz
cpython-5b5e81c637eb115b27b4c5c66cf1cf348c706162.tar.bz2
Merged revisions 59605-59624 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r59606 | georg.brandl | 2007-12-29 11:57:00 +0100 (Sat, 29 Dec 2007) | 2 lines Some cleanup in the docs. ........ r59611 | martin.v.loewis | 2007-12-29 19:49:21 +0100 (Sat, 29 Dec 2007) | 2 lines Bug #1699: Define _BSD_SOURCE only on OpenBSD. ........ r59612 | raymond.hettinger | 2007-12-29 23:09:34 +0100 (Sat, 29 Dec 2007) | 1 line Simpler documentation for itertools.tee(). Should be backported. ........ r59613 | raymond.hettinger | 2007-12-29 23:16:24 +0100 (Sat, 29 Dec 2007) | 1 line Improve docs for itertools.groupby(). The use of xrange(0) to create a unique object is less obvious than object(). ........ r59620 | christian.heimes | 2007-12-31 15:47:07 +0100 (Mon, 31 Dec 2007) | 3 lines Added wininst-9.0.exe executable for VS 2008 Integrated bdist_wininst into PCBuild9 directory ........ r59621 | christian.heimes | 2007-12-31 15:51:18 +0100 (Mon, 31 Dec 2007) | 1 line Moved PCbuild directory to PC/VS7.1 ........ r59622 | christian.heimes | 2007-12-31 15:59:26 +0100 (Mon, 31 Dec 2007) | 1 line Fix paths for build bot ........ r59623 | christian.heimes | 2007-12-31 16:02:41 +0100 (Mon, 31 Dec 2007) | 1 line Fix paths for build bot, part 2 ........ r59624 | christian.heimes | 2007-12-31 16:18:55 +0100 (Mon, 31 Dec 2007) | 1 line Renamed PCBuild9 directory to PCBuild ........
Diffstat (limited to 'Doc/library/re.rst')
-rw-r--r--Doc/library/re.rst22
1 files changed, 5 insertions, 17 deletions
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index 88912eb..49c5215 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -84,8 +84,6 @@ the null byte using the ``\number`` notation, e.g., ``'\x00'``.
The special characters are:
-.. %
-
``'.'``
(Dot.) In the default mode, this matches any character except a newline. If
the :const:`DOTALL` flag has been specified, this matches any character
@@ -297,8 +295,6 @@ The special sequences consist of ``'\'`` and a character from the list below.
If the ordinary character is not on the list, then the resulting RE will match
the second character. For example, ``\$`` matches the character ``'$'``.
-.. %
-
``\number``
Matches the contents of the group of the same number. Groups are numbered
starting from 1. For example, ``(.+) \1`` matches ``'the the'`` or ``'55 55'``,
@@ -384,9 +380,6 @@ there are three octal digits, it is considered an octal escape. Otherwise, it is
a group reference. As for string literals, octal escapes are always at most
three digits in length.
-.. % Note the lack of a period in the section title; it causes problems
-.. % with readers of the GNU info version. See http://www.python.org/sf/581414.
-
.. _matching-searching:
@@ -406,15 +399,11 @@ beginning with ``'^'``: ``'^'`` matches only at the start of the string, or in
:const:`MULTILINE` mode also immediately following a newline. The "match"
operation succeeds only if the pattern matches at the start of the string
regardless of mode, or at the starting position given by the optional *pos*
-argument regardless of whether a newline precedes it.
-
-.. % Examples from Tim Peters:
-
-::
+argument regardless of whether a newline precedes it. ::
>>> re.match("c", "abcdef") # No match
>>> re.search("c", "abcdef")
- <_sre.SRE_Match object at 0x827e9c0> # Match
+ <_sre.SRE_Match object at 0x827e9c0> # Match
.. _contents-of-module-re:
@@ -450,10 +439,9 @@ form.
but the version using :func:`compile` is more efficient when the expression
will be used several times in a single program.
- .. % (The compiled version of the last pattern passed to
- .. % \function{re.match()} or \function{re.search()} is cached, so
- .. % programs that use only a single regular expression at a time needn't
- .. % worry about compiling regular expressions.)
+ .. (The compiled version of the last pattern passed to :func:`re.match` or
+ :func:`re.search` is cached, so programs that use only a single regular
+ expression at a time needn't worry about compiling regular expressions.)
.. data:: I