Fix regex exceptions