contents   index   previous   next



RegExp.lastMatch

syntax:

RegExp.lastMatch

description:

This property has the text matched by the last pattern search. It is the same text as in element 0 of the array returned by some methods. RegExp.lastMatch is equivalent to RegExp["$&"], for compatibility with PERL.

 

Read-only property.

 

see:

RegExp exec(), String match(), RegExp returned array properties

 

example:

var str = "one two three two one";

var pat = /(t.o)/

pat.exec(str);

   // RegExp.lastMatch == "two"

 


RegExp.lastParen