diff options
author | Guido van Rossum <guido@python.org> | 1997-10-05 18:54:07 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-10-05 18:54:07 (GMT) |
commit | eb53ae492845609ba475e8fca8ee745fd3454ae6 (patch) | |
tree | 9de5e6e39de9fbb542996ad18a66768f322d72c5 /Doc/libre.tex | |
parent | 7974b0f2d8a91b4b2783e8bb93b8b809de833cf1 (diff) | |
download | cpython-eb53ae492845609ba475e8fca8ee745fd3454ae6.zip cpython-eb53ae492845609ba475e8fca8ee745fd3454ae6.tar.gz cpython-eb53ae492845609ba475e8fca8ee745fd3454ae6.tar.bz2 |
Fixed some stuff that was incorrectly copied from regex.
Diffstat (limited to 'Doc/libre.tex')
-rw-r--r-- | Doc/libre.tex | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/Doc/libre.tex b/Doc/libre.tex index 975bf38..a2bc1fd 100644 --- a/Doc/libre.tex +++ b/Doc/libre.tex @@ -227,7 +227,7 @@ equivalent to the set \code{[\^ \e t\e n\e r\e f\e v]}. equivalent to the set \code{[a-zA-Z0-9_]}. % \item[\code{\e W}] Matches any non-alphanumeric character; this is -equivalent to the set \code{[\^a-zA-Z0-9_]}. +equivalent to the set \code{[\^ a-zA-Z0-9_]}. \item[\code{\e Z}]Matches only at the end of the string. % @@ -341,12 +341,13 @@ Perform the same operation as \code{sub()}, but return a tuple Compiled regular expression objects support the following methods and attributes: -\renewcommand{\indexsubitem}{(regex method)} +\renewcommand{\indexsubitem}{(re method)} \begin{funcdesc}{match}{string\optional{\, pos}} - Return how many characters at the beginning of \var{string} match - the compiled regular expression. Return \code{-1} if the string - does not match the pattern (this is different from a zero-length - match!). + If zero or more characters at the beginning of \var{string} match + this regular expression, return a corresponding + \code{Match} object. Return \code{None} if the string does not + match the pattern; note that this is different from a zero-length + match. The optional second parameter \var{pos} gives an index in the string where the search is to start; it defaults to \code{0}. This is not @@ -357,10 +358,10 @@ attributes: \end{funcdesc} \begin{funcdesc}{search}{string\optional{\, pos}} - Return the first position in \var{string} that matches the regular - expression \code{pattern}. Return \code{-1} if no position in the - string matches the pattern (this is different from a zero-length - match anywhere!). + Scan through \var{string} looking for a location where this regular + expression produces a match. 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 second parameter has the same meaning as for the \code{match} method. |