Input data can be split into multiline strings using the special variable $/, also known as $INPUT_RECORD_SEPARATOR.
The /s and /m modifiers can be used to treat multiline data as if it were a single line or multiple lines, respectively. This affects the matching of ^ and $, as well as whether or not . will match a newline.
The special variables $&, $` and $' are always set when a successful match occurs
$1, $2, $3 etc are set after a successful match to the text matched by the first, second, third, etc sets of parentheses in the regular expression. These should only be used outside the regular expression itself, as they will not be set until the match has been successful.
Special non-capturing parentheses (?:...) can be used for grouping when you don't wish to set one of the numbered special variables.
Special metacharacters such as \1, \2 etc may be used within the regular expression itself, to refer to text previously matched.