Fix regex flags.