MyBB Community Forums

Full Version: Regex letters, numbers and underscores
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Could anyone help me with mycode regex. It should only allow: letters, numbers and underscores, so:
a-z, A-Z, 0-9, _

At the moment I'm using this:
\w is the letters, numbers and underscore expression.
so that would be,
Thanks, can you limit the number of characters as well?


Would that be correct?
Try this:


The pattern you posted would match too, but I personally prefer to wrap my capture groups for readability.