update password pattern matching with regular expression