28
Why this regex '^[0-9]+\.?[0-9]*$' match for 12.2 and 12,2 ?
var dot = '12.2',
comma = '12,2',
regex = '^[0-9]+\.?[0-9]*$';
alert( dot.match(regex) );
alert( comma.match(regex) );
While it works on regexpal.com