Use RegExp objects instead of eval for creating regular expressions to fix code execution vulnerability as pointed out by Shahar Tal and his team from Check Point Software Technologies.