Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • cool that you came up with an own solution. I assume that you do the length check then somewhere else. Some hints: {1} is superfluous, you simply don't need it, you don't need the round brackets inside a character class, when your char class has only one member you don't need a class, \w contains also the underscore and at last: you don't need the brackets around the whole expression. So you could simplify your expression to ^\w*\W\d*$ Commented Apr 23, 2012 at 6:41
  • @Stema thanks a lot I will simplify the expression , My length check is done in the configuration file , the pattern I used in my answer will only allow passwords like abc@123 , xyz#456 etc.thanks Commented Apr 23, 2012 at 6:52