[Python-checkins] CVS: python/dist/src/Doc/lib libre.tex,1.80,1.81

Fred L. Drake fdrake@users.sourceforge.net
Mon, 25 Mar 2002 12:23:01 -0800


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv18060/lib

Modified Files:
	libre.tex 
Log Message:
Document the finditer() function and method.
This closes SF bug #520904.

Explain that many of the escapes supported by string literals are also
supported by the RE compiler, and list which ones.
This closes SF bug #529923.


Index: libre.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v
retrieving revision 1.80
retrieving revision 1.81
diff -C2 -d -r1.80 -r1.81
*** libre.tex	18 Mar 2002 16:45:01 -0000	1.80
--- libre.tex	25 Mar 2002 20:22:59 -0000	1.81
***************
*** 372,379 ****
  \item[\code{\e Z}]Matches only at the end of the string.
  
- \item[\code{\e \e}] Matches a literal backslash.
- 
  \end{list}
  
  
  \subsection{Matching vs. Searching \label{matching-searching}}
--- 372,392 ----
  \item[\code{\e Z}]Matches only at the end of the string.
  
  \end{list}
  
+ Most of the standard escapes supported by Python string literals are
+ also accepted by the regular expression parser:
+ 
+ \begin{verbatim}
+ \a      \b      \f      \n
+ \r      \t      \v      \x
+ \\
+ \end{verbatim}
+ 
+ Note that octal escapes are not included.  While the parser can
+ attempt to determine whether a character is being specified by it's
+ ordinal value expressed in octal, doing so yields an expression which
+ is relatively difficult to maintain, as the same syntax is used to
+ refer to numbered groups.
+ 
  
  \subsection{Matching vs. Searching \label{matching-searching}}
***************
*** 545,548 ****
--- 558,568 ----
  \end{funcdesc}
  
+ \begin{funcdesc}{finditer}{pattern, string}
+   Return an iterator over all non-overlapping matches for the RE
+   \var{pattern} in \var{string}.  For each match, the iterator returns
+   a match object.  Empty matches are included in the result.
+   \versionadded{2.2}
+ \end{funcdesc}
+ 
  \begin{funcdesc}{sub}{pattern, repl, string\optional{, count}}
    Return the string obtained by replacing the leftmost non-overlapping
***************
*** 669,672 ****
--- 689,696 ----
  \begin{methoddesc}[RegexObject]{findall}{string}
  Identical to the \function{findall()} function, using the compiled pattern.
+ \end{methoddesc}
+ 
+ \begin{methoddesc}[RegexObject]{finditer}{string}
+ Identical to the \function{finditer()} function, using the compiled pattern.
  \end{methoddesc}