mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Added URL to HOWTO page, with reference to Regex HOWTO.
Corrected error: {,5} is not equivalent to {0,5}.
This commit is contained in:
parent
1d5f988457
commit
c1cea208bc
1 changed files with 6 additions and 6 deletions
|
@ -50,8 +50,9 @@ details of the theory and implementation of regular expressions,
|
||||||
consult the Friedl book referenced below, or almost any textbook about
|
consult the Friedl book referenced below, or almost any textbook about
|
||||||
compiler construction.
|
compiler construction.
|
||||||
|
|
||||||
A brief explanation of the format of regular expressions follows.
|
A brief explanation of the format of regular expressions follows. For
|
||||||
%For further information and a gentler presentation, consult XXX somewhere.
|
further information and a gentler presentation, consult the Regular
|
||||||
|
Expression HOWTO, accessible from \url{http://www.python.org/doc/howto/}.
|
||||||
|
|
||||||
Regular expressions can contain both special and ordinary characters.
|
Regular expressions can contain both special and ordinary characters.
|
||||||
Most ordinary characters, like \character{A}, \character{a}, or \character{0},
|
Most ordinary characters, like \character{A}, \character{a}, or \character{0},
|
||||||
|
@ -109,10 +110,9 @@ expression will match only \code{'<H1>'}.
|
||||||
|
|
||||||
\item[\code{\{\var{m},\var{n}\}}] Causes the resulting RE to match from
|
\item[\code{\{\var{m},\var{n}\}}] Causes the resulting RE to match from
|
||||||
\var{m} to \var{n} repetitions of the preceding RE, attempting to
|
\var{m} to \var{n} repetitions of the preceding RE, attempting to
|
||||||
match as many repetitions as possible. For example, \regexp{a\{3,5\}}
|
match as many repetitions as possible. For example, \regexp{a\{3,5\}}
|
||||||
will match from 3 to 5 \character{a} characters. Omitting \var{m} is the same
|
will match from 3 to 5 \character{a} characters. Omitting \var{n}
|
||||||
as specifying 0 for the lower bound; omitting \var{n} specifies an
|
specifies an infinite upper bound; you can't omit \var{m}.
|
||||||
infinite upper bound.
|
|
||||||
|
|
||||||
\item[\code{\{\var{m},\var{n}\}?}] Causes the resulting RE to
|
\item[\code{\{\var{m},\var{n}\}?}] Causes the resulting RE to
|
||||||
match from \var{m} to \var{n} repetitions of the preceding RE,
|
match from \var{m} to \var{n} repetitions of the preceding RE,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue