RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Password
Expression
^([a-zA-Z0-9]{6,18}?)$
Description
My simple but effective password regex. The password can only contain letters and/or digits and must be at least 6 characters long and no more than 20. I know it says {6,18} but it just works out that way. The question mark was added for optimization. Also, the password can not begin or end with a space or underscore.
Matches
abc123
Non-Matches
_abc123_
Author Rating: The rating for this expression. tedcambron
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Can't contain other characters
Name: Ted Cambron
Date: 9/20/2014 7:26:00 PM
Comment:
This pattern does limit just to letters and digits. #12343& or $10000! would not pass


Title: You Are Wrong
Name: blah
Date: 6/6/2009 10:04:42 AM
Comment:
aaaa will match, that seems like 4 characters to me.


Title: Thank You
Name: Ted Cambron
Date: 2/22/2008 8:31:31 PM
Comment:
Thanks for the advice. I think?


Title: Can contain other characters
Name: Michael Ash
Date: 2/22/2008 1:25:27 PM
Comment:
This pattern does not limit just to letters and digits. #12343& or $10000! would pass


Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials