Catch regex errors