Patient Guy wrote:
var re = /beta/;
var string = "alphabetagamma";
var report = re.exec(string);
should not:
re.lastIndex = 9;
after the last line of execution?
No. The lastIndex property is only changed if the global flag is set
(that is, /beta/g).
The index property of the result array indicates where the matched
substring starts; in the example above, report.index will evaluate to 5.
[snip]
Mike