Search

Hello people,

I have a text input field which will be used to store multiple comma separated email addresses. I'm looking to write a validation rule for it - sadly regex still baffles at times!

The default Symphony email validation rule looks like this:

/^\w(?:\.?[\w%+-]+)*@\w(?:[\w-]*\.)+?[a-z]{2,}$/i

My multiple email address validation is taking shape as such:

/^[a-zA-Z0-9_\-\.]+@[a-zA-Z0-9_\-\.]+\.[a-zA-Z ,]{2,5}$/i

The above appeared to work when I tested it in this regex sandbox however it fails validation in Symphony.

Any input would be appreciated.

JL

Not sure why it'd work elsewhere but not in Symphony. Perhaps it's a difference between JS and PHP regex?

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details