Skip to content

Instantly share code, notes, and snippets.

@maxxscho
Last active March 31, 2016 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxxscho/796a1b604ff66f7a99230d03ec2f76c1 to your computer and use it in GitHub Desktop.
Save maxxscho/796a1b604ff66f7a99230d03ec2f76c1 to your computer and use it in GitHub Desktop.
Regular expression for matching a number with optional decimals, with "." or "," as comma-separator. The number can be signed or unsigned.
/^\-?[0-9]+([\.|\,]{1}[0-9]{1,2})?$/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment