check that password matches regex