fix regexp performance issue