# Password Validation

**URL:** <https://dmap-community.ductus.global/t/password-validation/3642>\
**Category:** CDB and CDB API\
**Created:** [May 14, 2021, 9:56am UTC](https://dmap-community.ductus.global/t/password-validation/3642 "2021-05-14T09:56:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Haripriya1](https://avatars.discourse-cdn.com/v4/letter/h/e9c0ed/32.png) [@Haripriya1](https://dmap-community.ductus.global/u/Haripriya1)\
**Post date:** [May 14, 2021, 9:56am UTC](https://dmap-community.ductus.global/t/password-validation/3642/1 "2021-05-14T09:56:59Z")

</div>

Hi Experts,  
While Iam creating the user,Iam trying to validate the password as per password policy configured in cdb. Please provide suggestions for user password validation as per pwd policy

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [May 14, 2021, 5:12pm UTC](https://dmap-community.ductus.global/t/password-validation/3642/2 "2021-05-14T17:12:24Z")

</div>

Example:

```auto
leaf password {
  type string {
    pattern ".*[0-9]+.*"; // at least one digit
    pattern ".*[a-z]+.*"; // at least one lower case alpha
    pattern ".*[A-Z]+.*"; // at least one upper case alpha
    pattern ".*[<>~;:!@#/$%^&*=-]+.*"; // at least one symbol (add more symbols)
    pattern ".* .*" { // no spaces
      modifier invert-match;
    }
    length 8..max;
  }
}

```

See also for example this post [To Include additional escape characters in pattern](http://dmap-community.ductus.global/t/to-include-additional-escape-characters-in-pattern/3117/2)
