XF 2.0 Regular Expression on Registration

AtomiCAST

Member
Hey there

I've been trying for a few hours to get a Regex for Name_Lastname (In that order, including the underscore and the capitalization on both starting portions).

A friend of mine came up with [A-Z][a-zA-Z]*_[A-Z][a-zA-Z]* but that certainly doesn't seem to work with xenForo's regex field so i came here to ask for some advice.

Ideally it should (Like i said), match the Name_Lastname (For roleplaying purposes) and just Letters, no special characters other than the Underscore that separates it.

I would love if you guys could lend me a hand on this as it's driving me crazy

Thanks in advance!
 
Do you mean the "User name match regular expression" option? If so, you need to include the delimiters and modifiers (for PCRE). So something like:
/^[A-Z][a-zA-Z]*_[A-Z][a-zA-Z]*$/
 
Back
Top Bottom