Regex

Number

  • Test number with comma decimal separator.
var str = "122,22";
var re = new RegExp("^-?(?:\d+|\d{1,3}(?:.\d{3})+)(?:\,\d+)?$", "");
var myArray = re.test(str);
programming/javascript/regex.txt · Last modified: 2018-06-21 19:48 (external edit)
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0