using System; using System.Globalization; using System.Text.RegularExpressions; using UnityEngine; public class RegexUtilities { bool invalid = false; public bool IsValidEmail(string strIn) { invalid = false; if (String.IsNullOrEmpty(strIn)) return false; // Use IdnMapping class to convert Unicode domain names. try { strIn = Regex.Replace(strIn, @"(@)(.+)$", this.DomainMapper, RegexOptions.None); } catch (RegexMatchTimeoutException) { return false; } if (invalid) return false; // Return true if strIn is in valid e-mail format. try { return Regex.IsMatch(strIn, @"^(?("")("".+?(?