in reply to Re^2: conditional regex
in thread conditional regex

Indeed that is much simpler. I wish I'd thought of it :)