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.
-       .*+\nMatches 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.
 
-       .*+\nMatches everything up to next line, same as the above.
-             (\2?+.)Same as subpattern 1.
-       .*+\nAdvances 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:
- ...AThree characters, then an "A" (literal character).
-     .*+\nSkip through the rest of the line, and the newline character...
- \1?+If we captured group one, consume it!
-   ..ATwo characters, then an "A" (literal character).
-     .*+\nNext line.
- \2?+Consume if possible.
-   .AYou get the idea, but I'll write text anyway. Same as upstairs.
-     .*+\nAdvance.
- \3?+......
- AEnd 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 extended version.