RegExp Object

Microsoft Office JScript

Microsoft® JScript® RegExp Object  Language Reference 
Version 3 

See Also                   Methods                   Properties


Description
Stores information on regular expression pattern searches.
Syntax
RegExp.propertyname

The propertyname argument is one of the RegExp object properties.

Remarks
The RegExp object cannot be created directly, but is always available for use. Its properties have undefined as their value until a successful regular expression search has been completed.

The following example illustrates the use of the RegExp object:

function matchDemo()
{
  var s;
  var re = new RegExp("d(b+)(d)","ig");
  var str = "cdbBdbsbdbdz";
  var arr = re.exec(str);
  s = "$1 contains: " + RegExp.$1 + "<BR>";
  s += "$2 contains: " + RegExp.$2 + "<BR>";
  s += "$3 contains: " + RegExp.$3;
  return(s);
}