lastIndex

Summary

Sets or retrieves the last index for a global match.

Signatures

Click on a signature to select it and view its documentation.

Usage

public property int lastIndex()

Returns

The last index in the string to start the regular expression match from.

Description

This getter property will return the lastIndex for the regular expression. The lastIndex is the index in the string that the regular expression will start matching from in a global match (using the g flag).

Examples

Basic Usage
1
2
3
4
5
import System;
 
System.RegExp re = new System.RegExp(/a/g);
bool match = re.test("There is a way.");
Console.log(re.lastIndex); // 13

Share

HTML | BBCode | Direct Link