This documentation is archived and is not being maintained.
source Property
Visual Studio 2010
Returns a copy of the text of the regular expression pattern. Read-only.
rgExp.source
The following example illustrates the use of the source property:
var src = "The quick brown fox";
var re = /brown/g;
var s = "";
s += "The string '" + src + "'";
if (re.test(src))
s += " contains ";
else
s += " does not contain ";
s += "'" + re.source + "'.";
print (s);
The output of this program is as follows.
The string 'The quick brown fox' contains 'brown'.
Show: