CSoftZ.Common.Utils.RegexUtilities.DomainMapper C# (CSharp) Method

DomainMapper() private method

Use IdnMapping class to convert Unicode domain names.
private DomainMapper ( Match match ) : string
match System.Text.RegularExpressions.Match
return string
        private string DomainMapper(Match match)
        {
            // IdnMapping class with default property values.
            IdnMapping idn = new IdnMapping();

            string domainName = match.Groups[2].Value;
            try
            {
                domainName = idn.GetAscii(domainName);
            }
            catch (ArgumentException)
            {
                invalid = true;
            }
            return match.Groups[1].Value + domainName;
        }