DEV Community

s
s

Posted on

Answer:

Try changing your regex to:

^[A-Za-z0-9]+$

You have in your current regex |.* this is effectively "or any charachter (including whitespace)"

Top comments (0)