Indeed.
Quoting and a bit paraphrasing "Mastering Regular Expressions 2nd Edition":
A match mode can change the meaning of "$" to match before any embedde
+d newline (or Unicode line terminator as well). When supported, "\Z"
+usually matches what the "unmoded" "$" matches, which often means to
+match at the end of the string, or before a string-ending newline. To
+ complement these, "\z" matches only at the end of the string, period
+, without regard to any newline.
..
//s stands for Single Line Mode which makes the dot match any characte
+r.
..
//m stands for Multi Line Mode which changes how ^& $ are considered b
+y the regex engine. ^ is then begin of 1 line out of the many lines i
+n the string and not begin of string and $ is end of 1 line out of th
+e many lines in the string and not end of string.
..
Caret "^" matches at the beginning of the text being searched, and, if
+ in an enhanced line-anchor match mode after any newline.
..
\A always matches only at the start of the text being searched, regard
+less of single or multi line match mode.
..
"\Z" matches what the "unmoded" "$" matches, which means to match at t
+he end of the string, or before a string-ending newline. To complemen
+t these, "\z" matches only at the end of the string, period, without
+regard to any newline.
With thanks to Jeffrey Friedl's Regex Holy Book! ;-)
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.