DEV Community

s
s

Posted on

2 1

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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more