added pattern functions to password class