Sun Chili!Soft ASP Sun Chili!Soft
ASP Sun Microsystems

 

JScript Regular Expression Object lastIndex Property

Specifies the index at which to start the next match.

Syntax: JScript Regular Expression Object lastIndex Property

rgexp.lastIndex [= index]

Arguments: JScript Regular Expression Object lastIndex Property

rgexp

A Regular Expression object. Can be a variable name or a literal. Required.

index

The index from which to begin the next search.

Remarks: JScript Regular Expression Object lastIndex Property

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.

Copyright 2002 Sun Microsystems, Inc. All rights reserved. Legal Notice.