var str="The man is at a dance, dancing, but he will not marry or tarry with Harry, nor has he ever tarried with Harry, nor will he be found to be tarrying";
var pattern=/dance|dancing|\btarry\b|tarried|tarrying/gi;
alert(str.match(pattern));
var pattern = /\bdanc\w+|\b[a-z]+arr\w+/gi;
alert(str.match(pattern));
var pattern = /\bdanc\w+|\b[a-gj-z]+arr\w+/gi;
alert(str.match(pattern));
var pattern = /\b(tarr[iy](\w+))/gi;
alert(str.match(pattern));
var pattern = /\b(tarr[iy](\w+)?)/gi;
alert(str.match(pattern));

</script>

Quizmaster: What character in A.A.Milne's "Winnie The Pooh" is named after his son?
Contestant: Pooh.

nervousprogramm

11-04-2012, 01:58 PM

That has confused me even more =(

I need to create a functoin so when i type alert( match1("HELLO","hell")
would return true

Philip M

11-04-2012, 02:07 PM

That has confused me even more =(

I need to create a functoin so when i type alert( match1("HELLO","hell")
would return true