Created
November 28, 2013 09:23
-
-
Save songzhiyong/7689274 to your computer and use it in GitHub Desktop.
6-20字符 javascript
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
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
<script type='text/javascript'> | |
var reg=/^[\w\_\-]{6,20}$/; | |
alert(reg.test("12345")); | |
alert(reg.test("12345+")); | |
alert(reg.test("12345a-_")); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment