MyBB Community Forums

Full Version: Regex in custom profile field causes error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've created a custom profile field called "Discord username" with the following Regular Expression: ^[^#]{2,32}#\d{4}$ (

Forum URL:

When users try to create a new account, even if they enter a value that respects the Regex (such as hello#1234) it will error.

If a user tries to edit their profile and add any value under Discord username, the following error appears at the top of the page;

This is a new installation of 1.8.21

For now, I've removed the REGEX from that custom profile field and things are working fine.
MyBB uses # as the regex delimiter internally, so escape it with a backslash:
Excellent, thank you! Smile