Jhonatan Sandoval
Jhonatan Sandoval

Reputation: 1293

regexp pattern to match alphanumeric strings without initial spaces

i have input pattern setted like this: pattern="[a-zA-Z0-9]+"

When i type a space in the input, it returns me a error message ( which is good ).

But, when i type mi full name, for e.g. Jhonatan Sandoval, it does too.

How can i sett the pattern only with no spaces before the name?

Upvotes: 0

Views: 141

Answers (1)

damgad
damgad

Reputation: 1446

That will work as you expect:

pattern="[a-zA-Z0-9][a-zA-Z0-9 ]+"

Upvotes: 1

Related Questions