I have the following orginal code of preg match
for(var i = 0;i<5;i++)
{
patt1 = /Colour1\/(\d+)"/;
var ab=(data.match(patt1)[1]);
alert(ab);
}
I am wondering if i can use the variable i instead of 1(for 5 loops),like below example.I can use the value i outside but not inside pregmatch.
for(var i = 0;i<5;i++)
{<br>
patt1 = /Colour"+i+"\/(\d+)"/;
var ab=(data.match(patt1)[1]);
alert(ab);
}