A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/javascript/RegExp/lastMatch below:

lastMatch · WebPlatform Docs

lastMatch Summary

Returns the last matched characters from any regular expression search. Read-only.

Syntax
RegExp.lastMatch
Examples

The following example illustrates the use of the lastMatch property:


    var re = new RegExp("d(b+)(d)","ig");
    var str = "cdbBdbsbdbdz";

    
    var arr = re.exec(str);

    
    var s = ""
    s += ": " + RegExp. + "<br />";
    s += ": " + RegExp. + "<br />";
    s += ": " + RegExp. + "<br />";
    s += "input: " + RegExp.input + "<br />";
    s += "lastMatch: " + RegExp.lastMatch + "<br />";
    s += "leftContext: " + RegExp.leftContext + "<br />";
    s += "rightContext: " + RegExp.rightContext + "<br />";
    s += "lastParen: " + RegExp.lastParen + "<br />";

    document.write(s);
Remarks

The object associated with this property is always the global RegExp object.

The initial value of the lastMatch property is an empty string. The value of the lastMatch property changes whenever a successful match is made.

See also Other articles Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4