Fetching multiple matched values from a given string.

Vishalneeraj-24503
Posted by Vishalneeraj-24503 under JavaScript category on | Points: 40 | Views : 178
Using the Match method,we can achieve:-
var Reg_Exp = /[a-zA-z]+/;
var Matches = document.getElementByID('txt1').value.match(Reg_Exp);

for(var cnt = 0; cnt<=Matches.length-1; cnt++)
{
alert(Matches[cnt]);
}

Comments or Responses

Login to post response