A line terminator is a one- or two-character sequence that marks the end of a line of the input character sequence. The following are recognized as line terminators:
A newline (line feed) character ('
A carriage-return character followed immediately by a newline character
A standalone carriage-return character ('
A next-line character ('
A line-separator character ('
A paragraph-separator character ('
If UNIX_LINES mode is activated, then the only line terminators recognized are newline characters.
The regular expression
. matches any character except a line terminator
unless the DOTALL flag is specified.
By default, the regular expressions
$ ignore line
terminators and only match at the beginning and the end, respectively, of the entire input
sequence. If MULTILINE mode is activated then
^ matches at the beginning of input
and after any line terminator except at the end of input. When in MULTILINE mode
$ matches just before a line terminator or the end of
the input sequence.