var str = "he was dancing and singing. ";var re = /[a-z]+ing\b/ig;
var match;
while (match = re.exec(str)) {
alert(match);
}