Regex for email -


i have specific rules local , domain part of email. email local part: -latin letters allowed: z , z -number allowed: 0 9 -following special characters allowed: !#$%&'*+-/=?^_`{|}~ -dot “.” allowed must not first or last character , 2 dots must not appear consecutively. -following latin characters diacritics allowed: àèìòùÀÈÌÒÙáéíóúýÁÉÍÓÚÝâêîôûÂÊÎÔÛãñõÃÑÕäëïöüÿÄËÏÖÜŸçÇߨøÅ寿œ -other characters not allowed -64 characters length maximum

email domain must match requirements hostname, list of dot-separated dns labels, each label being limited length of 63 characters , following rules: -latin letters allowed: z , z -number allowed: 0 9 -hyphen “-“ allowed must not first or last character -following latin characters diacritics allowed: àèìòùÀÈÌÒÙáéíóúýÁÉÍÓÚÝâêîôûÂÊÎÔÛãñõÃÑÕäëïöüÿÄËÏÖÜŸçÇߨøÅ寿œ -other characters not allowed -total email address: 256 characters length maximum

i using below regex. verify , suggest make short if possible.

/^[a-za-za-zÀ-ÖØ-öø-ÿäëïöüÿÄËÏÖÜŸçÇߨøÅ寿œ0-9!#$%&'+/=?^_{|}~-]+(?:\.[a-za-zÀ-ÖØ-öø-ÿäëïöüÿÄËÏÖÜŸçÇߨøÅ寿œ0-9!#$%&'*+\/=?^_{|}~]+)@(?:a-za-za-zÀ-ÖØ-öø-ÿäëïöüÿÄËÏÖÜŸçÇߨøÅ寿œ0-9?.)+a-z0-9?$/;

thanks in advance

i checked https://regex101.com/ understanding regex , got it.


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -