catch regex exceptions