Last active
October 19, 2016 07:16
-
-
Save MaxXxiMast/f4c2886a3583157c248b6790d024e857 to your computer and use it in GitHub Desktop.
#RegExp for a alphanumeric value not starting with 0, can have no special characters other that _ or -
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//validation check for sku of a product | |
//alphanumeric | |
var regExp = "/^[^0][A-Za-z0-9_-]{3,50}$/"; | |
// ^ start of string | |
// [^0] 1st char will not be 0 | |
// [A-Za-z0-9_-] A or B ... Z or a or b or ... z or 0 or 1 or ... 9 or underscores(_) or hyphen/dash (-) | |
// {3,50} length between 3-50 | |
// $ end of string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment