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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay