diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2000-10-05 12:35:29 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2000-10-05 12:35:29 (GMT) |
commit | 7a90db613166e568a12621aa5448ce15eaf5c5d0 (patch) | |
tree | 2401c0e173e4ff339a0fad718185bac5bdc075d2 /Doc/lib/libre.tex | |
parent | 1f7838bcc0282d82bf51a25b194f8471574abce6 (diff) | |
download | cpython-7a90db613166e568a12621aa5448ce15eaf5c5d0.zip cpython-7a90db613166e568a12621aa5448ce15eaf5c5d0.tar.gz cpython-7a90db613166e568a12621aa5448ce15eaf5c5d0.tar.bz2 |
Document expand() method of MatchObjects
Diffstat (limited to 'Doc/lib/libre.tex')
-rw-r--r-- | Doc/lib/libre.tex | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/lib/libre.tex b/Doc/lib/libre.tex index 578d9cb..c6eca4d 100644 --- a/Doc/lib/libre.tex +++ b/Doc/lib/libre.tex @@ -597,6 +597,15 @@ The pattern string from which the regex object was compiled. \class{MatchObject} instances support the following methods and attributes: +\begin{methoddesc}[MatchObject]{expand}{template} + Return the string obtained by doing backslash substitution on the +template string \var{template}, as done by the \method{sub()} method. +Escapes such as \samp{\e n} are converted to the appropriate +characters, and numeric backreferences (\samp{\e 1}, \samp{\e 2}) and named +backreferences (\samp{\e g<1>}, \samp{\e g<name>}) are replaced by the contents of the +corresponding group. +\end{methoddesc} + \begin{methoddesc}[MatchObject]{group}{\optional{group1, \moreargs}} Returns one or more subgroups of the match. If there is a single argument, the result is a single string; if there are |