RegExp.rightContext
JavaScript 1.2+, JScript 3.0+ Nav4+, NES3+, IE4+ Syntax
regexp.rightContext
Description
The rightContext property of the RegExp object represents the substring following the most recent pattern match.
Example
Listing 6.224 shows how the rightContext property is used.
Listing 6.224 Example of rightContext
<html> <body> <script language="JavaScript"> <!–– Hide // define a regular expression pattern and match globally pat = /be*/gi; // create a string object var str = "Eat Drink and be Merry."; // create an array to hold the results myArray = pat.exec(str); document.write("In the string: " + "<b>" + "Eat Drink and be Merry" + "</b><br><br>"); document.write("The RegExp.rightContext is: " + RegExp.rightContext); // ... |
Get Pure JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.