Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eb53ae4

Browse files
committed
Fixed some stuff that was incorrectly copied from regex.
1 parent 7974b0f commit eb53ae4

2 files changed

Lines changed: 22 additions & 20 deletions

File tree

Doc/lib/libre.tex

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ \subsection{Regular Expressions}
227227
equivalent to the set \code{[a-zA-Z0-9_]}.
228228
%
229229
\item[\code{\e W}] Matches any non-alphanumeric character; this is
230-
equivalent to the set \code{[\^a-zA-Z0-9_]}.
230+
equivalent to the set \code{[\^ a-zA-Z0-9_]}.
231231

232232
\item[\code{\e Z}]Matches only at the end of the string.
233233
%
@@ -341,12 +341,13 @@ \subsection{Regular Expression Objects}
341341
Compiled regular expression objects support the following methods and
342342
attributes:
343343

344-
\renewcommand{\indexsubitem}{(regex method)}
344+
\renewcommand{\indexsubitem}{(re method)}
345345
\begin{funcdesc}{match}{string\optional{\, pos}}
346-
Return how many characters at the beginning of \var{string} match
347-
the compiled regular expression. Return \code{-1} if the string
348-
does not match the pattern (this is different from a zero-length
349-
match!).
346+
If zero or more characters at the beginning of \var{string} match
347+
this regular expression, return a corresponding
348+
\code{Match} object. Return \code{None} if the string does not
349+
match the pattern; note that this is different from a zero-length
350+
match.
350351

351352
The optional second parameter \var{pos} gives an index in the string
352353
where the search is to start; it defaults to \code{0}. This is not
@@ -357,10 +358,10 @@ \subsection{Regular Expression Objects}
357358
\end{funcdesc}
358359

359360
\begin{funcdesc}{search}{string\optional{\, pos}}
360-
Return the first position in \var{string} that matches the regular
361-
expression \code{pattern}. Return \code{-1} if no position in the
362-
string matches the pattern (this is different from a zero-length
363-
match anywhere!).
361+
Scan through \var{string} looking for a location where this regular
362+
expression produces a match. Return \code{None} if no
363+
position in the string matches the pattern; note that this is
364+
different from finding a zero-length match at some point in the string.
364365

365366
The optional second parameter has the same meaning as for the
366367
\code{match} method.

Doc/libre.tex

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ \subsection{Regular Expressions}
227227
equivalent to the set \code{[a-zA-Z0-9_]}.
228228
%
229229
\item[\code{\e W}] Matches any non-alphanumeric character; this is
230-
equivalent to the set \code{[\^a-zA-Z0-9_]}.
230+
equivalent to the set \code{[\^ a-zA-Z0-9_]}.
231231

232232
\item[\code{\e Z}]Matches only at the end of the string.
233233
%
@@ -341,12 +341,13 @@ \subsection{Regular Expression Objects}
341341
Compiled regular expression objects support the following methods and
342342
attributes:
343343

344-
\renewcommand{\indexsubitem}{(regex method)}
344+
\renewcommand{\indexsubitem}{(re method)}
345345
\begin{funcdesc}{match}{string\optional{\, pos}}
346-
Return how many characters at the beginning of \var{string} match
347-
the compiled regular expression. Return \code{-1} if the string
348-
does not match the pattern (this is different from a zero-length
349-
match!).
346+
If zero or more characters at the beginning of \var{string} match
347+
this regular expression, return a corresponding
348+
\code{Match} object. Return \code{None} if the string does not
349+
match the pattern; note that this is different from a zero-length
350+
match.
350351

351352
The optional second parameter \var{pos} gives an index in the string
352353
where the search is to start; it defaults to \code{0}. This is not
@@ -357,10 +358,10 @@ \subsection{Regular Expression Objects}
357358
\end{funcdesc}
358359

359360
\begin{funcdesc}{search}{string\optional{\, pos}}
360-
Return the first position in \var{string} that matches the regular
361-
expression \code{pattern}. Return \code{-1} if no position in the
362-
string matches the pattern (this is different from a zero-length
363-
match anywhere!).
361+
Scan through \var{string} looking for a location where this regular
362+
expression produces a match. Return \code{None} if no
363+
position in the string matches the pattern; note that this is
364+
different from finding a zero-length match at some point in the string.
364365

365366
The optional second parameter has the same meaning as for the
366367
\code{match} method.

0 commit comments

Comments
 (0)