I want to test if a sentence like type var1,var2,var3
is matching a text declaration or not.
So, I used the following code :
var text = "int a1,a2,a3",
reg = /int ((([a-z_A-Z]+[0-9]*),)+)$/g;
if (reg.test(text)) console.log(true);
else console.log(false)
Could someone help me find a good regular expression matching expressions as in the example above?