Skip to content

Instantly share code, notes, and snippets.

@sjy
Created March 2, 2018 07:51
Show Gist options
  • Save sjy/86b71920faf15dfdc922f59f911c8559 to your computer and use it in GitHub Desktop.
Save sjy/86b71920faf15dfdc922f59f911c8559 to your computer and use it in GitHub Desktop.
Valid Digit Number Pattern
const pattern = /^[1-9]\d{0,4}(\.\d{0,2})?$|^0(\.\d{0,2})?$/;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment