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

Skip to content

Commit 7a90db6

Browse files
committed
Document expand() method of MatchObjects
1 parent 1f7838b commit 7a90db6

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Doc/lib/libre.tex

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,15 @@ \subsection{Match Objects \label{match-objects}}
597597

598598
\class{MatchObject} instances support the following methods and attributes:
599599

600+
\begin{methoddesc}[MatchObject]{expand}{template}
601+
Return the string obtained by doing backslash substitution on the
602+
template string \var{template}, as done by the \method{sub()} method.
603+
Escapes such as \samp{\e n} are converted to the appropriate
604+
characters, and numeric backreferences (\samp{\e 1}, \samp{\e 2}) and named
605+
backreferences (\samp{\e g<1>}, \samp{\e g<name>}) are replaced by the contents of the
606+
corresponding group.
607+
\end{methoddesc}
608+
600609
\begin{methoddesc}[MatchObject]{group}{\optional{group1, \moreargs}}
601610
Returns one or more subgroups of the match. If there is a single
602611
argument, the result is a single string; if there are

0 commit comments

Comments
 (0)