lastIndex Property (Regular Expression)
Language Reference |
See Also Applies To
Specifies the index at which to start the next match.
rgexp.lastIndex [= index]
The lastIndex method syntax has these parts:
Part Description rgexp Required. A Regular Expression object. Can be a variable name or a literal. index The index from which to begin the next search.
The lastIndex property is modified by the exec method, and the match, replace, and split methods of the String object.
The following rules apply to values of lastIndex:
- If lastIndex is greater than the length of the string, the test and exec methods fail, and lastIndex is set to zero.
- If lastIndex is equal to the length of the string, the regular expression matches if the pattern matches the empty string. Otherwise, the match fails and lastIndex is reset to zero.
- Otherwise, lastIndex is set to the next position following the most recent match.
© 1997 by Microsoft Corporation. All rights reserved.
|file: /Techref/inet/iis/jscript/htm/js724.htm, 3KB, , updated: 2008/1/31 10:31, local time: 2018/10/21 02:18,
|©2018 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?|
<A HREF="http://www.piclist.com/techref/inet/iis/jscript/htm/js724.htm"> lastIndex Property (Regular Expression)</A>
|Did you find what you needed?|
PICList 2018 contributors:
o List host: MIT, Site host massmind.org, Top posters @20181021 RussellMc, Van Horn, David, Sean Breheny, David C Brown, Isaac M. Bavaresco, Neil, Bob Blick, John Gardner, Harold Hallikainen, AB Pearce - UKRI STFC,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
Welcome to www.piclist.com!