Fixed FLAG fallbacks by improving my earlier RegEx.