JavaScript » RegExp » lastMatch

Syntax:
RegExp.lastMatch

The RegExp lastMatch is deprecated in Javascript 1.5.

 

This property is the last matched characters. As this property is static, you always use RegExp.lastMatch.

Examples

Code:
rexp = /([^aeiou\s]){2}([aeiou])+([^aeiou\s]){2}/
rexp("the fisherman's tale")
Output:
sherm
Explanation:

This code would search through the string "the fisherman's tale" for a match with the regular expression of two consonants, one or more vowels and two consonants. In this case it will match the 'sherm' of 'fisherman'.