Regular Expression Usernames

I was wondering if someone could help me with the regular expression usernames. I only want to allow letters, numbers, and underscores. Any help would be greatly appreciated.


XenForo moderator
Staff member
Try this: ^[a-zA-Z0-9_]+$

I was almost there, just needed a bit of help from Mike (I omitted the [] and +$).