I attempted to create a RegEx that matched usernames with 1 to 20 characters and no more than one space (optional though). And by trial and error obtained this chunky RegEx:
[0-9A-Za-z]{3,20} ?[0-9A-Za-z]{1,20}
How can I optimize this RegEx to be shorter and generally better?
Via Active questions tagged javascript - Stack Overflow https://ift.tt/2FdjaAW
Comments
Post a Comment