summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libre.tex
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-07-23 21:14:59 (GMT)
committerFred Drake <fdrake@acm.org>2001-07-23 21:14:59 (GMT)
commitc547b46c067656b39c564a84a2979ec985e7b869 (patch)
treed1138decd1bb143865a9aa53d25fd2e07abfa341 /Doc/lib/libre.tex
parent5e9eb98ff6217faf00ff4eac44397dc650dd0753 (diff)
downloadcpython-c547b46c067656b39c564a84a2979ec985e7b869.zip
cpython-c547b46c067656b39c564a84a2979ec985e7b869.tar.gz
cpython-c547b46c067656b39c564a84a2979ec985e7b869.tar.bz2
Be more specific about corner cases in the description of the $ RE syntax,
and include an example where the MULTILINE flag makes a real difference. This closes SF bug #441600.
Diffstat (limited to 'Doc/lib/libre.tex')
-rw-r--r--Doc/lib/libre.tex11
1 files changed, 7 insertions, 4 deletions
diff --git a/Doc/lib/libre.tex b/Doc/lib/libre.tex
index 4cadac1..cec5be2 100644
--- a/Doc/lib/libre.tex
+++ b/Doc/lib/libre.tex
@@ -96,10 +96,13 @@ specified, this matches any character including a newline.
\item[\character{\^}] (Caret.) Matches the start of the string, and in
\constant{MULTILINE} mode also matches immediately after each newline.
-\item[\character{\$}] Matches the end of the string, and in
-\constant{MULTILINE} mode also matches before a newline.
-\regexp{foo} matches both 'foo' and 'foobar', while the regular
-expression \regexp{foo\$} matches only 'foo'.
+\item[\character{\$}] Matches the end of the string or just before the
+newline at the end of the string, and in \constant{MULTILINE} mode
+also matches before a newline. \regexp{foo} matches both 'foo' and
+'foobar', while the regular expression \regexp{foo\$} matches only
+'foo'. More interestingly, searching for \regexp{foo\e d} in
+'foo1\textbackslash nfoo2\textbackslash n' matches 'foo2' normally,
+but 'foo1' in \constant{MULTILINE} mode.
\item[\character{*}] Causes the resulting RE to
match 0 or more repetitions of the preceding RE, as many repetitions