Consider the string \"AB 1 BA 2 AB 3 BA\". How can I match the content between \"AB\" and \"BA\" in a non-greedy fashion (in awk)? >
The other answer didn't really answer: how to match non-greedily? Looks like it can't be done in (G)AWK. The manual says this:
awk (and POSIX) regular expressions always match the leftmost, longest sequence of input characters that can match.
https://www.gnu.org/software/gawk/manual/gawk.html#Leftmost-Longest
And the whole manual doesn't contain the words "greedy" nor "lazy". It mentions Extended Regular Expressions, but for greedy matching you'd need Perl-Compatible Regular Expressions. So… no, can't be done.