JavaScript RegExp Object
The lastIndex property specifies the index at which to start the next match.
Note: This property only works if the "g" modifier is set.
This property returns an integer that specifies the character position immediately after the last match found by exec( ) or test( ) methods.
Note: exec( ) and test( ) reset lastIndex to 0 if they do not get a match.
![]()
The lastIndex property is supported in all major browsers.
Do a global search for "ain" in a string, and output the index after a match is found:
JavaScript RegExp Object
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $7.95/mo SEO Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| XML Editor - Free Trial! |
| FREE Website BUILDER |
| Free Website Templates Free CSS Templates |
| Make Your Own Website |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|