Self-referencing groups (Qtax Trick)
/^(?:.(?=.*+\n(\1?+.).*+\n(\2?+.).*+\n(\3?+.)))*?...A.*+\n\1?+..A.*+\n\2?+.A.*+\n\3?+A/m
Explanation:
^
Starts of a line.
(?:.
Matches any character except newline.
-
(?=
Positive lookahead: Asserts that the following can be matched. This part is for capturing.
-
.*+\n
Matches everything up to the line, then the newline itself as well.
-
(\1?+.)
-
-
?+
: If this group has been matched, consume and add a character to the group, otherwise just match a character, and advance through.
-
.*+\n
Matches everything up to next line, same as the above.
-
(\2?+.)
Same as subpattern 1.
-
.*+\n
Advances the line.
-
(\3?+.)
Same as subpattern 1 and 2.
-
)
Finishes the lookahead.
)*?
Zero or more, match reluctantly.
The above group does the following. Note the colored groups:

(source: gyazo.com)
However because this group is reluctantly quantified, this happens:

(source: gyazo.com)
Note that while the colored groups may or may not be captured, the pointer location remains unchanged during the capture. Hence, at the very first iteration all capturing groups captures nothing. As such, we move onto the next part of the regexp:
...A
Three characters, then an "A" (literal character).
-
.*+\n
Skip through the rest of the line, and the newline character...
\1?+
If we captured group one, consume it!
-
..A
Two characters, then an "A" (literal character).
-
.*+\n
Next line.
\2?+
Consume if possible.
-
.A
You get the idea, but I'll write text anyway. Same as upstairs.
-
.*+\n
Advance.
\3?+
......
A
End of match!
If you don't like text, I'll just draw it one more time:

(source: gyazo.com)
Let's all bow to our master -
“vertical” regex matching in an ASCII “image”
Here's a code demo, and here's a regex demo of an ex
tended version.