w3schools
  
HOME HTML CSS XML JAVASCRIPT ASP PHP SQL MORE...   References Examples Forum About
BEST WEB HOSTING JustHosts

JavaScript lastMatch Property


RegExp Object Reference Complete RegExp Object Reference

Definition and Usage

The lastMatch property is the last matched characters.

Syntax

RegExp.lastMatch


Example

In the following example we will see the last match from the string:

<script type="text/javascript">
var str = "The rain in Spain stays mainly in the plain";
var patt1 = new RegExp("ain");

patt1.test(str);
document.write("Match found: " + RegExp.lastMatch);
</script>

Try it yourself »

RegExp Object Reference Complete RegExp Object Reference


DreamTemplate


WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Top 10 Web Hosting
UK Reseller Hosting
Web Hosting
FREE Web Hosting
Top Web Hosting
Windows Hosting
WEB BUILDING
XML Editor – Free Trial!
FREE Flash Website
FREE Web Templates
FLIGHT TICKETS
Find the cheapest flight
to any destination now!
EDUCATION
US Web Design Schools
HTML Certification
JavaScript Certification
XML Certification
PHP Certification
ASP Certification
STATISTICS
Browser Statistics
Browser OS
Browser Display