Brunet.Applications.IPAddresses.AddIfMatch C# (CSharp) Метод

AddIfMatch() защищенный Метод

Called by GetAddresses to add the value to the correct place in the hashtable.
protected AddIfMatch ( Regex re, string line, Hashtable ht, string key ) : bool
re System.Text.RegularExpressions.Regex The regular expression to match.
line string The line to check.
ht System.Collections.Hashtable The hashtable to store the data if their is a match.
key string Position in the key in the hashtable to store the result
Результат bool
    protected bool AddIfMatch(Regex re, string line, Hashtable ht, string key) {
      Match m = re.Match(line);
      if( m.Success ) {
        Group g = m.Groups[m.Groups.Count - 1];
        CaptureCollection cc = g.Captures;
        ht[key] = cc[0].ToString();
        return true;
      }
      return false;
    }