JavaScript lastIndex Property
Complete RegExp Object Reference
Definition and Usage
The lastIndex property specifies the index (placement) in the string where to
start the next match.
The index is a number specifying the placement of the first character after
the last match.
This property only works if the "g" modifier is set.
Syntax
Example
In the following example we will see the index of the string after a match is
found:
<script type="text/javascript">
var str = "The rain in Spain stays mainly in the plain";
var patt1 = new RegExp("ain", "g");
patt1.test(str);
document.write("Match found. index now at: " + patt1.lastIndex);
</script>
|
Try-It-Yourself Demos
lastIndex
How to use lastIndex property to check where to start the next match.
Complete RegExp Object Reference
Learn how your website performs under various load conditions
|
|
WAPT
is a load, stress and performance testing tool for websites and web-based applications.
In contrast to "800-pound gorilla" load testing tools, it is designed to minimize the learning
curve and give you an ability to create a heavy load from a regular workstation.
WAPT is able to generate up to 3000 simultaneously acting virtual users using standard hardware configuration.
Virtual users in each profile are fully customizable. Basic and NTLM authentication methods are supported.
Graphs and reports are shown in real-time at different levels of detail, thus helping to manage the testing process.
Download the free 30-day trial!
|
|