public TokenEnumerator(string pattern) { if (string.IsNullOrEmpty(pattern) == false) { if (pattern.Contains("\r\n")) { pattern = pattern.Replace("\r\n", "\n"); } } if (string.IsNullOrEmpty(pattern)) { patternLength = 0; } else { patternLength = pattern.Length; } this.pattern = pattern; currentLocation = 0; Location = new FileLocation(); }