Commit c547b46c authored by Fred Drake's avatar Fred Drake

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.
parent 5e9eb98f
...@@ -96,10 +96,13 @@ specified, this matches any character including a newline. ...@@ -96,10 +96,13 @@ specified, this matches any character including a newline.
\item[\character{\^}] (Caret.) Matches the start of the string, and in \item[\character{\^}] (Caret.) Matches the start of the string, and in
\constant{MULTILINE} mode also matches immediately after each newline. \constant{MULTILINE} mode also matches immediately after each newline.
\item[\character{\$}] Matches the end of the string, and in \item[\character{\$}] Matches the end of the string or just before the
\constant{MULTILINE} mode also matches before a newline. newline at the end of the string, and in \constant{MULTILINE} mode
\regexp{foo} matches both 'foo' and 'foobar', while the regular also matches before a newline. \regexp{foo} matches both 'foo' and
expression \regexp{foo\$} matches only 'foo'. '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 \item[\character{*}] Causes the resulting RE to
match 0 or more repetitions of the preceding RE, as many repetitions match 0 or more repetitions of the preceding RE, as many repetitions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment