1

What is the correct Validation Pattern format to add to a Formerly email field in the Craft admin control panel if I want to stop any submissions from email addresses with a .ru TLD?

I've tried:

!(\.ru)
/^((?!\.ru).)*$/s

But they do nothing.

1

Try find the regex string in https://regex101.com/ where you can define your pos and neg examples.

.*(?:(?!ru).).$

See https://stackoverflow.com/questions/16398471/regex-for-string-not-ending-with-given-suffix

3
  • Thanks for responding, but it doesn't work – user8844 Sep 27 '18 at 20:09
  • My code is pure regex code, it should probably be converted to php. Try add delimiters /.*(?:(?!ru).).$/mu – lenka Sep 28 '18 at 22:07
  • Yes, the problem is probably with the plugin that I am trying to use, I dont know what the format should be, or how it is supposed to work, and there doesn't appear to be any documentation – user8844 Sep 29 '18 at 11:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.