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}$ (https://i.imgur.com/yy0VpKE.png)



Forum URL: https://lifepunch.net/forums



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; https://i.imgur.com/3NIPp6Q.png



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:
^[^\#]{2,32}\#\d{4}$
Excellent, thank you! Smile