PDA

View Full Version : Prevent users from using multiple spaces in a row in username


michael11121
12-11-2017, 12:20 AM
I'm looking to restrict usernames to using only alphabetic letters and numbers. I also need to prevent multiple spaces in a row between characters but I want to allow spaces. My current username regular expression is this ^[a-zA-Z0-9 ]+$. Any ideas?

edit: Solved, thank you.

MarkFL
12-11-2017, 06:16 AM
Users can enter multiple spaces in a row, but these are automatically reduced to one space before being stored in the db (at least that's what my vB 4.2.5 dev site did when I tested it.).