Microsoft® JScript®
source Property
 Language Reference 
Version 3 

See Also                  Applies To

Returns a copy of the text of the regular expression pattern. Read-only.

The rgexp argument is a Regular expression object. It can be a variable name or a literal.

The following example illustrates the use of the source property:

function SourceDemo(re, s)
  var s1;
  // Test string for existence of regular expression.
  if (re.test(s))
    s1 = " contains ";
    s1 = " does not contain ";
  // Get the text of the regular expression itself.
  return(s + s1 + re.source);
} Бревенчатые дома, сруб бани, сруб дома