next up previous contents
Next: input (or $_) Up: Properties Previous: multiline   Contents

lastIndex

Description

It is an integer which specifies the string position at which to start the next match. The lastIndex is modified by the exec or test method when the global property is true. 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.


Syntax

rgexp.lastIndex




Copyright ©2000-2007 Shanghai TopCMM Software Technologies. All Rights Reserved.