Am using it this way
function checkSyntax()
{
var value = '(1,0),(2,1),(3,1),(4,0)';
regex= /^(\(\d{1,3},[0-1]\)(,{0,1}))+$/;
var nArray = value.match(regex);
if (nArray==null)
alert("not a proper pattern"

;
else
alert("Proper pattern"

;
}
value can take (1,0),(2,1),(3,0)....
The problem with this code is it works fine even when i give (1,0),(2,0),
the pattern must not end with a comma..