I tried using your regex, then rewrote it to be clearer: +@domain\.(?|in)/iuBut that doesn't work either, so don't feel bad, it wasn't you. Trying to trigger failure, I used the regex of simply the word "regex", so, theoretically, only entering the word "regex" would be an acceptable email. It handily wrapped it as /regex/iu, then didn't work.It accepted anything. Putting failme@thisiswrong.com and it worked. Putting "anything" worked.. wtf?I don't think a regex validator is working for that form. :-(I managed to hack up a solution though, for you I mean, if you open /include/class.user.php, around line 203 edit like the following: static function fromVars($vars, $create=true, $update=false) {
// Try and lookup by email address
$user = static:($vars);
if (!$user && $create) {
if(!preg_match('+@domain\.(?|in)/iu',$vars)){
return false;
}
That seems to trigger the validation error message when you input an invalid message, and allows it through if you put in a correct address.I left the admin configured regex for the form input to 'regex' as it seems to ignore it, I think it might only use it for admin-created users.. or something. Hmm.I then configured the Validation Error message to something useful, and the placeholder/help-text etc, then tried it. :-)Regex changes explained:The flags /iu use case-insensitivity anyway, so no need to specify a-z & A-Z, however it's also easier to use \w instead, which allows the unicode flag to do something.. (a-z is ascii only, so, no unicode).Why use 0-9 when you can use \d.. In a character class, "." is already a ".", you don't need the slash.(something) is a capturing group, using (?) is a non-capturing groupputting the domain\. part outside the group makes the group more obvious, in this case, just the tld part is variable.