--- Comment #3 from Nicolas Sitbon <nicolas.sitbon@???> 2014-12-30 16:51:11 ---
(In reply to comment #2) > I think this is a documentation problem. Grep programs apply patterns to files
> line by line, so \A does indeed anchor to the start of a line, not to the start
> of the whole file. I think all grep programs behave this way for ^, and \A is
> just a variant of that.
> Because you have used the -M option, the actual matching string is permitted to
> extend over several lines, with (in this case) the newlines being matched by
> \s. I have made a note to try to improve the documentation.
As far as I know only pcregrep allows the multiline mode other programs match
line by line. This is weird to allow the subject to span multiple lines without
honoring the right behaviour for the anchor \A.