//[<date|yyyy-MM-dd> <hour|HH:mm:ss>] <string> <string|optional> <string> <ip> public static LogEntry parse(string line) { LogEntry logEntry = new LogEntry(); string[] tokens = line.Split(' '); tokens[0] += ' ' + tokens[1]; logEntry.Date = DateTime.ParseExact(tokens[0], "[yyyy-MM-dd HH:mm:ss]", CultureInfo.InvariantCulture); int field = 2; logEntry.Hash = tokens[field++]; if (tokens.Length == 6) { logEntry.Tag = tokens[field++]; } logEntry.Nick = tokens[field++]; logEntry.IPAddress = IPAddress.Parse(tokens[field++]); return logEntry; }