Input:- ((ab)|(ba)) 2 ((a|b)*) 5 ((a*)(b(a*))) 100 Output:- 2 32 100 here we have Only regex(r) and string length(l) as a parameter in function.....from these two parameter we have to find count of string which is match to our regex.
var count = 0; for(var i=l;i>0;i--) { if(r.match(l)) { count++; } } console.log(count);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)