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 ( '\n'),
A carriage-return character followed immediately by a newline character ( "\r\n"),
A standalone carriage-return character ( '\r'),
A next-line character ( '\u0085'),
A line-separator character ( '\u2028'), or
A paragraph-separator character ( '\u2029)
The regular expression . matches any character except a line terminator.
The regular expressions ^ and $ ignore line terminators and only match at the beginning and the end, respectively, of the entire input sequence.