input Property ($_) (RegExp) (JavaScript)

Returns the string against which a regular expression search was performed. Read-only.




The object associated with this property is always the global RegExp object.

The value of input property is modified any time the searched string is changed.

The following example illustrates the use of the input property:

function inputDemo(){  
   var s;  
   var re = new RegExp("d(b+)(d)","ig");  
   var str = "cdbBdbsbdbdz";  
   var arr = re.exec(str);  
   s = "The string used for the match was " + RegExp.input;   


Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Also supported in Store apps (Windows 8 and Windows Phone 8.1). See Version Information.

Applies To: RegExp Object

See Also

Regular Expression Syntax (JavaScript)