August 1999
Intermediate to advanced
1488 pages
72h 53m
English
regexp.lastParen
The lastParen property of the RegExp object represents the last parenthesized substring match. It returns a string value for the last parenthesized substring.
Listing 6.221 shows how the lastParen property is used.
<html> <body> <script language="JavaScript"> <!–– Hide // define a regular expression exp = new RegExp("(please)", "g"); // create a string object str = "Will you (please) stop yelling!"; myArray = exp.exec(str); // inform user what the lastParen property is document.write("The RegExp.lastParen is: " + "<b>" + RegExp.lastParen + "</b>"); // End Hide ––> </script> </body> ... |
Read now
Unlock full access