I want to make a greedy match to an alternative of either zero to 'm' consecutive occurences of 'a' or zero to 'n' consecutive occurences of 'b'. If I do
/a{,m}|b{,n}/
it will not work because when I have sequences of 'b', it will match with 'a{,m}', and the alternative 'b{,n}' will not be looked at, and it will not be a greedy match.