Ejemplo n.º 1
0
 private ArrayList ConvertPatternsToRegexs(StringItem[] patterns)
 {
     ArrayList Matchers = new ArrayList();
     foreach (StringItem RawPattern in patterns)
     {
         StringBuilder RegexPattern = new StringBuilder(RawPattern.StringValue);
         RegexPattern.Replace("\\", "\\\\");
         RegexPattern.Replace(".", "\\.");
         RegexPattern.Replace("*", ".*");
         RegexPattern.Replace("$", "\\$");
         RegexPattern.Replace("^", "\\^");
         RegexPattern.Replace("{", "\\{");
         RegexPattern.Replace("[", "\\[");
         RegexPattern.Replace("(", "\\(");
         RegexPattern.Replace(")", "\\)");
         RegexPattern.Replace("+", "\\+");
         if (RegexPattern.Length > 0)
         {
             RegexPattern.Insert(0, "^");
             RegexPattern.Append("$");
         }
         string PatternText = RegexPattern.ToString();
         if ((PatternText.StartsWith("^.*")))
         {
             PatternText = PatternText.Substring(3);
         }
         if ((PatternText.EndsWith(".*$")))
         {
             PatternText = PatternText.Substring(0, RegexPattern.Length - 3);
         }
         Matchers.Add(new Regex(PatternText));
     }
     return Matchers;
 }
Ejemplo n.º 2
0
 public StringList(params string[] args)
 {
     foreach (string @string in args)
     {
         StringItem Item = new StringItem(@string);
         this.StringItems.Add(Item.StringValue, Item);
     }
 }
Ejemplo n.º 3
0
 public void Add(string key, StringItem value)
 {
     this.InnerHashtable.Add(key, value);
     value.Index = this.Count;
     this.IndexedTable.Add(value.Index, value.StringValue);
 }
Ejemplo n.º 4
0
 public void Add(string key, StringItem value)
 {
     this.InnerHashtable.Add(key, value);
     value.Index = this.Count;
     this.IndexedTable.Add(value.Index, value.StringValue);
 }