public AutoEmailLinkParser(string validPreviousCharacters = DefaultValidPreviousCharacters) { ValidPreviousCharacters = validPreviousCharacters; // Ugly / Can't work with if email starts with any word char unicode var openingChars = new List <char>(); for (int i = 'a'; i <= 'z'; i++) { openingChars.Add((char)i); } for (int i = 'A'; i <= 'Z'; i++) { openingChars.Add((char)i); } for (int i = '0'; i <= '9'; i++) { openingChars.Add((char)i); } openingChars.Add('<'); OpeningCharacters = openingChars.ToArray(); _listOfCharCache = new ListOfCharCache(); }
/// <summary> /// Initializes a new instance of the <see cref="AutoLinkParser"/> class. /// </summary> public AutoLinkParser(AutoLinkOptions options) { Options = options ?? throw new ArgumentNullException(nameof(options)); OpeningCharacters = new char[] { 'h', // for http:// and https:// 'f', // for ftp:// 'm', // for mailto: 'w', // for www. }; _listOfCharCache = new ListOfCharCache(); }