0

Valid case:

  • abc123

Invalid case:

  • abca123 (a is repeated)

The closest I've got from this answer is /(?=^[A-Za-z0-9]+$)(.)+.*\1.*/, but it is the opposite of what I want, it returns true if there're repeated characters, and false otherwise.

Does anyone know how to write this regex? I.e. only allows [a-z0-9] distinct characters.

Wenfang Du
  • 5,689
  • 6
  • 40
  • 66

0 Answers0