ansman/validate.js

how to multiple regex or similar

Closed this issue · 1 comments

I am new to validate.js and cant figure this out, hopefully this is something simple... how to perform multiple regex or similar to validate the following requirements independently

  • Must be at least 8 characters long
  • Must include at least one upper case letter
  • Must include at least one lower case letter
  • Must include at least one number
  • Must include at least one special character

I was able to do this with format with single regex, but I would like to do it with multiple validates. Is this possible?

thank you

Sadly you can only use a validator once per property. But you could easily write a custom validator that does this.