private Regex PrepareRegexp()
{
string regPattern = this.findString;
if (this.isRegularExpression == false)
{
regPattern = regPattern.Replace(".", "\\.");
regPattern = regPattern.Replace("+", "\\+");
regPattern = regPattern.Replace("*", "\\*");
regPattern = regPattern.Replace("?", "\\?");
regPattern = regPattern.Replace("[", "\\[");
regPattern = regPattern.Replace("]", "\\]");
regPattern = regPattern.Replace("$", "\\$");
regPattern = regPattern.Replace("{", "\\{");
regPattern = regPattern.Replace("}", "\\}");
regPattern = regPattern.Replace("(", "\\(");
regPattern = regPattern.Replace(")", "\\)");
}
RegexOptions options = RegexOptions.Multiline;
if (this.isIgnoreWhiteSpace) options = options | RegexOptions.IgnorePatternWhitespace;
if (this.isCaseSensitive == false) options = options | RegexOptions.IgnoreCase;
return new Regex(regPattern, options);
}
#endregion