[Python-checkins] CVS: python/dist/src/Doc/lib libre.tex,1.65,1.66
Fred L. Drake
fdrake@users.sourceforge.net
Thu, 02 Aug 2001 13:52:02 -0700
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv6672/lib
Modified Files:
libre.tex
Log Message:
Add a caveat about boundary conditions and RE concatenation, so that the
documents do not make an overly-strong assertion about the properties of
RE concatenation.
Add an example of RE{m,} syntax and what it will and will not match.
Index: libre.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v
retrieving revision 1.65
retrieving revision 1.66
diff -C2 -d -r1.65 -r1.66
*** libre.tex 2001/08/01 16:56:51 1.65
--- libre.tex 2001/08/02 20:52:00 1.66
***************
*** 62,72 ****
Regular expressions can be concatenated to form new regular
expressions; if \emph{A} and \emph{B} are both regular expressions,
! then \emph{AB} is also an regular expression. If a string \emph{p}
matches A and another string \emph{q} matches B, the string \emph{pq}
! will match AB. Thus, complex expressions can easily be constructed
! from simpler primitive expressions like the ones described here. For
! details of the theory and implementation of regular expressions,
! consult the Friedl book referenced below, or almost any textbook about
! compiler construction.
A brief explanation of the format of regular expressions follows. For
--- 62,73 ----
Regular expressions can be concatenated to form new regular
expressions; if \emph{A} and \emph{B} are both regular expressions,
! then \emph{AB} is also a regular expression. If a string \emph{p}
matches A and another string \emph{q} matches B, the string \emph{pq}
! will match AB if \emph{A} and \emph{B} do no specify boundary
! conditions that are no longer satisfied by \emph{pq}. Thus, complex
! expressions can easily be constructed from simpler primitive
! expressions like the ones described here. For details of the theory
! and implementation of regular expressions, consult the Friedl book
! referenced below, or almost any textbook about compiler construction.
A brief explanation of the format of regular expressions follows. For
***************
*** 139,145 ****
match as many repetitions as possible. For example, \regexp{a\{3,5\}}
will match from 3 to 5 \character{a} characters. Omitting \var{n}
! specifies an infinite upper bound; you can't omit \var{m}. The comma
! may not be omitted or the modifier would be confused with the
! previously described form.
\item[\code{\{\var{m},\var{n}\}?}] Causes the resulting RE to
--- 140,148 ----
match as many repetitions as possible. For example, \regexp{a\{3,5\}}
will match from 3 to 5 \character{a} characters. Omitting \var{n}
! specifies an infinite upper bound; you can't omit \var{m}. As an
! example, \regexp{a\{4,\}b} will match \code{aaaab}, a thousand
! \character{a} characters followed by a \code{b}, but not \code{aaab}.
! The comma may not be omitted or the modifier would be confused with
! the previously described form.
\item[\code{\{\var{m},\var{n}\}?}] Causes the resulting RE to