Skip to content

Instantly share code, notes, and snippets.

@kentcdodds
Created May 17, 2013 15:42
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 kentcdodds/5599909 to your computer and use it in GitHub Desktop.
Save kentcdodds/5599909 to your computer and use it in GitHub Desktop.
Common regex tests. I'll just put them here so I can easily copy them later when I don't want to make my brain figure it out again.
var isValidInt = function(str) {
var regex = /^\d+$/;
return regex.test(str);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment