Extract a Substring Using Regular Expression

Note that although all of the regular expression does not show in the gray box below that selecting and copying it will capture all of the relevant text.

// Note all the backslashes for escaping the proper characters.
// The whole part to get this value out is below.

var searchString = 
new RegExp("div id\=\"zk\-comp\-[0-9]+\" class\=\"panels first\-set\"\>\<div id\=\"zk\-comp\-[0-9]+\" class\=\"es\-tab\-panel\"\>\<div id\=\"zk\-comp\-[0-9]+\" class\=\"es\-scrollable\-tall\"\>");
var leftIndex = "div id=\"";
var rightIndex = "\"";

var zk157 = null;

if(false != searchString.test(origText))
{

  var result = searchString.exec(origText);
  
  zk157= new String(result);

  $context.result.postMessage($context.result.LEVEL_INFO, "First Filter: "+ zk157);

  zk157=zk157.substring(zk157.indexOf(leftIndex) + leftIndex.length);

  $context.result.postMessage($context.result.LEVEL_INFO, "Second Filter: "+ zk157);
  
  zk157=zk157.substring(0, zk157.indexOf(rightIndex));

  $context.result.postMessage($context.result.LEVEL_INFO, "zk157= " +zk157);  
}