August 1999
Intermediate to advanced
1488 pages
72h 53m
English
regexp.leftContext
The leftContext property of the RegExp object represents the substring preceding the most recent pattern match.
Listing 6.222 shows how the leftContext property is used.
<html> <body> <script language="JavaScript"> <!–– Hide // define a regular expression pattern and match globally pat = /is*/g; // create a string object var str = "I know where the fish is tonight."; // create an array to hold the results myArray = pat.exec(str); document.write("In the string: " + "<b>" + "I know where the fish is tonight" + "</b><br><br>"); document.write("The RegExp.leftContext is: " + ... |
Read now
Unlock full access