20 namespace Contrib.Regex
28 private System.Text.RegularExpressions.Regex _rPattern;
35 public void Compile(
string pattern)
37 _rPattern =
new System.Text.RegularExpressions.Regex(pattern,
38 System.Text.RegularExpressions.RegexOptions.Compiled);
46 public bool Match(
string s)
48 return _rPattern.IsMatch(s);
57 public string Prefix()
71 if (other == null)
return false;
72 if (
this == other)
return true;
74 if (_rPattern != null ? !_rPattern.Equals(other._rPattern) : other._rPattern != null)
80 public override bool Equals(
object obj)
86 public override int GetHashCode()
88 return (_rPattern != null ? _rPattern.GetHashCode() : 0);