> For the complete documentation index, see [llms.txt](https://kinesis-school-of-programming.gitbook.io/nestjs-unleashed/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinesis-school-of-programming.gitbook.io/nestjs-unleashed/improvements-tips-module/improvements/password-validation.md).

# Password validation

It's time to improve the validation for the password.

In the **Core module**, in the **Validation section**, we used some of the decorators from the **Class Validator** package to validate the fields for creating a user. However, the **password** field was left with the simplest validation. In this section, we'll improve it.

We'll do so using a **Regular Expression** (regex) to have a more flexible validation. However, it would become an untidy solution if we just left it in the DTO itself. Due to this reason, we'll also implement a **Custom Validator** to encapsulate this validation, and even use multiple validations for a robust, reusable solution.
