I need a regex to make the validation of an username field. I need to accept just alphanumeric chars and max one space.
What I tried is:
^[a-z0-9]+[ ][a-z0-9]+$
It's working but it doesn't seems the right solution for this problem. Can someone guide me on how to optimize this regex? Thanks.