contents   index   previous   next



RegExp.leftContext

syntax:

RegExp.leftContext

description:

This property has the text before, that is, to the left of, the text matched by the last pattern search. RegExp.leftContext is equivalent to RegExp["$`"], for compatibility with PERL.

 

Read-only property.

 

see:

RegExp.lastMatch, RegExp.rightContext

 

example:

var str = "one two three two one";

var pat = /(t.o)/

pat.exec(str);

   // RegExp.leftContext == "one "

 


RegExp.rightContext