search

Home  >  Q&A  >  body text

JavaScript - Asking for advice on password regularity

/^(\w){8,50}$/ This is a regular pattern for 8 to 50 alphanumeric underscores. Now we need to add support for all special symbols (such as %@, etc.) , how to modify

PHP中文网PHP中文网2725 days ago634

reply all(4)I'll reply

  • 仅有的幸福

    仅有的幸福2017-06-12 09:30:59

    /^(.*){8,50}$/
    matches any characters, not only special characters

    reply
    0
  • 怪我咯

    怪我咯2017-06-12 09:30:59

    Try it

    /^[^\s]{8,50}$/g

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-06-12 09:30:59

    /^[w%@]{8,50}/Just put the special characters you need to add into the [] character set. [] means matching any element in it.

    reply
    0
  • 三叔

    三叔2017-06-12 09:30:59

    /^(s*){8,50}$/ Try it

    reply
    0
  • Cancelreply