hoTools.Find.FindAndReplace.PrepareRegexp C# (CSharp) Method

PrepareRegexp() private method

Prepare a regular expression and returns it
private PrepareRegexp ( ) : Regex
return System.Text.RegularExpressions.Regex
        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