Why this regex \'^[0-9]+\\.?[0-9]*$\' match for 12.2 and 12,2 ?
\'^[0-9]+\\.?[0-9]*$\'
jsFiddle
var dot = \'12.2\', comma = \'12,2\', regex = \'^[0-9