The Regexp.$1...$9 property is used to return text that matches a subexpression in the regular expression pattern. A group that resembles the match method in C #.
A partial expression within each parenthesis in a regular expression is a subexpression.
This property is a read-only property of the RegExp global object, which is supported by all major browsers. Grammar
RegExp. $n
The value of n is between [1, 9], which represents the textual content of the nth subexpression. For example, regexp.$1 represents the textual content that the first subexpression matches. return value
The value of the Regexp.$1...$9 property is a string that returns the text matched by the nth subexpression in the last regular expression match.
Although the parentheses in the regular expression pattern can have any number of them, this property saves only the first 9 matching text.
Note: The REGEXP here is a global object, and Regexp.$1...$9 is a global property. When performing any regular expression matching operation, JavaScript automatically updates the global properties on the global object RegExp to store the matching results for this regular expression pattern. When a regular expression match is executed again, the global properties on the regexp are updated to overwrite the previous stored data to reflect the matching result of this regular expression pattern. Example & Description
var str = "x98y87z65";//three digit part with parentheses, representing the subexpression var reg =/^x (\d+) Y (\d+) Z (\d+) $/; reg.test (str); The matching method of other regular expressions such as exec () can also be used, the same as Document.writeln (regexp.$1); Document.writeln (regexp.$2); Document.writeln (regexp.$3);
<a str = ' href= ' http://www.365mini.com/"title=" Home "target=" _blank ">CodePlayer</a>";
Extract URL reg =/<a\s[^>]*href= "([^" >]+) "[^>]*>/;
Reg.exec (str); Document.writeln (regexp.$1); http://www.365mini.com/