catch regex error