According to the Perl documentation for regular expressions :
By default, the character "^" is guaranteed to correspond only to the beginning of a line ... Inline lines of a new line will not be matched by a symbol "^" ... However, you can treat the line as a multi-line buffer, so that "^" will match after any new line inside the line ... you can do this using the / m modifier for the pattern matching operator.
The “after any new line” part means that it will only match at the beginning of the second and subsequent lines. What if I want to combine at the beginning of the line any (1st, 2nd, etc.)?
EDIT: OK, it seems that at first the file has specification information (3 characters) and that they confuse me. Any way to get ^ anyway?
EDIT: So, in the end it works (there is no specification yet), but now it seems that the Perl documentation is wrong, as it says “after any new line”
source share