summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libre.tex
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-10-13 16:03:52 (GMT)
committerGuido van Rossum <guido@python.org>1998-10-13 16:03:52 (GMT)
commit7d447aabbf6a97f5d2a988e56fb9381cdfba32d6 (patch)
tree98082aeae3545c55d7114f674e31a49c73d770a5 /Doc/lib/libre.tex
parent3f08d40bd8df3ad8665ee08b25facd8e231499ce (diff)
downloadcpython-7d447aabbf6a97f5d2a988e56fb9381cdfba32d6.zip
cpython-7d447aabbf6a97f5d2a988e56fb9381cdfba32d6.tar.gz
cpython-7d447aabbf6a97f5d2a988e56fb9381cdfba32d6.tar.bz2
Moved search and match around so that search is documented first.
Diffstat (limited to 'Doc/lib/libre.tex')
-rw-r--r--Doc/lib/libre.tex50
1 files changed, 25 insertions, 25 deletions
diff --git a/Doc/lib/libre.tex b/Doc/lib/libre.tex
index ca1d88b..a6e1316 100644
--- a/Doc/lib/libre.tex
+++ b/Doc/lib/libre.tex
@@ -364,10 +364,13 @@ leftmost such \character{\#} through the end of the line are ignored.
\end{datadesc}
-\begin{funcdesc}{escape}{string}
- Return \var{string} with all non-alphanumerics backslashed; this is
- useful if you want to match an arbitrary literal string that may have
- regular expression metacharacters in it.
+\begin{funcdesc}{search}{pattern, string\optional{, flags}}
+ Scan through \var{string} looking for a location where the regular
+ expression \var{pattern} produces a match, and return a
+ corresponding \class{MatchObject} instance.
+ Return \code{None} if no
+ position in the string matches the pattern; note that this is
+ different from finding a zero-length match at some point in the string.
\end{funcdesc}
\begin{funcdesc}{match}{pattern, string\optional{, flags}}
@@ -378,15 +381,6 @@ leftmost such \character{\#} through the end of the line are ignored.
match.
\end{funcdesc}
-\begin{funcdesc}{search}{pattern, string\optional{, flags}}
- Scan through \var{string} looking for a location where the regular
- expression \var{pattern} produces a match, and return a
- corresponding \class{MatchObject} instance.
- Return \code{None} if no
- position in the string matches the pattern; note that this is
- different from finding a zero-length match at some point in the string.
-\end{funcdesc}
-
\begin{funcdesc}{split}{pattern, string, \optional{, maxsplit\code{ = 0}}}
Split \var{string} by the occurrences of \var{pattern}. If
capturing parentheses are used in \var{pattern}, then the text of all
@@ -469,6 +463,12 @@ Perform the same operation as \function{sub()}, but return a tuple
\code{(\var{new_string}, \var{number_of_subs_made})}.
\end{funcdesc}
+\begin{funcdesc}{escape}{string}
+ Return \var{string} with all non-alphanumerics backslashed; this is
+ useful if you want to match an arbitrary literal string that may have
+ regular expression metacharacters in it.
+\end{funcdesc}
+
\begin{excdesc}{error}
Exception raised when a string passed to one of the functions here
is not a valid regular expression (e.g., unmatched parentheses) or
@@ -482,6 +482,18 @@ Perform the same operation as \function{sub()}, but return a tuple
Compiled regular expression objects support the following methods and
attributes:
+\begin{methoddesc}[RegexObject]{search}{string\optional{, pos}\optional{,
+ endpos}}
+ Scan through \var{string} looking for a location where this regular
+ expression produces a match, and return a
+ corresponding \class{MatchObject} instance. Return \code{None} if no
+ position in the string matches the pattern; note that this is
+ different from finding a zero-length match at some point in the string.
+
+ The optional \var{pos} and \var{endpos} parameters have the same
+ meaning as for the \method{match()} method.
+\end{methoddesc}
+
\begin{methoddesc}[RegexObject]{match}{string\optional{, pos}\optional{,
endpos}}
If zero or more characters at the beginning of \var{string} match
@@ -503,18 +515,6 @@ attributes:
searched for a match.
\end{methoddesc}
-\begin{methoddesc}[RegexObject]{search}{string\optional{, pos}\optional{,
- endpos}}
- Scan through \var{string} looking for a location where this regular
- expression produces a match, and return a
- corresponding \class{MatchObject} instance. Return \code{None} if no
- position in the string matches the pattern; note that this is
- different from finding a zero-length match at some point in the string.
-
- The optional \var{pos} and \var{endpos} parameters have the same
- meaning as for the \method{match()} method.
-\end{methoddesc}
-
\begin{methoddesc}[RegexObject]{split}{string, \optional{,
maxsplit\code{ = 0}}}
Identical to the \function{split()} function, using the compiled pattern.