Tuesday, November 18, 2008

Regular expressions for passwords

This is a link post for some of the regular expressions that can be used for passwords.  Specifically, you can use them for asp.net's passwordStrengthRegularExpression. Note: Be sure to test them *before* you use them in a production app. The table indicates the minimum length, if it requires at least one upper, lower, digit or special character.

Expression Len Upper Lower Digit Special
^.*(?=.{10,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).*$ 10 Y Y Y Y
^.*(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*$ 8 Y Y Y N
^.*(?=.{10,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).*$ 10 Y Y Y Y

Links for Linq Joins

Some articles on joins for Linq. This one is basic, just to grok the concept. This post from CodeGuru is a little more detailed and explains things a little better. Multiple join conditions are shown here. This post uses extension methods to handle a date. I can definitely see some uses for this.

There are some interesting things you can do like finding all of the overlapping date ranges in a table.