Example #1
0
 public static string StripAllTags(string strToStrip)
 {
     strToStrip = Regex.Replace(strToStrip, "</p(?:\\s*)>(?:\\s*)<p(?:\\s*)>", "\n\n", RegexOptions.IgnoreCase | RegexOptions.Compiled);
     strToStrip = Regex.Replace(strToStrip, "<br(?:\\s*)/>", "\n", RegexOptions.IgnoreCase | RegexOptions.Compiled);
     strToStrip = Regex.Replace(strToStrip, "\"", "''", RegexOptions.IgnoreCase | RegexOptions.Compiled);
     strToStrip = Globals.StripHtmlXmlTags(strToStrip);
     return(strToStrip);
 }
Example #2
0
 public static string StripForPreview(string content)
 {
     content = Regex.Replace(content, "<br>", "\n", RegexOptions.IgnoreCase | RegexOptions.Compiled);
     content = Regex.Replace(content, "<br/>", "\n", RegexOptions.IgnoreCase | RegexOptions.Compiled);
     content = Regex.Replace(content, "<br />", "\n", RegexOptions.IgnoreCase | RegexOptions.Compiled);
     content = Regex.Replace(content, "<p>", "\n", RegexOptions.IgnoreCase | RegexOptions.Compiled);
     content = content.Replace("'", "&#39;");
     return(Globals.StripHtmlXmlTags(content));
 }
Example #3
0
 public static string CleanSearchString(string searchString)
 {
     if (string.IsNullOrEmpty(searchString))
     {
         return(null);
     }
     searchString = searchString.Replace("*", "%");
     searchString = Globals.StripHtmlXmlTags(searchString);
     searchString = Regex.Replace(searchString, "--|;|'|\"", " ", RegexOptions.Compiled | RegexOptions.Multiline);
     searchString = Regex.Replace(searchString, " {1,}", " ", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.IgnoreCase);
     return(searchString);
 }
Example #4
0
        public static string CleanSearchString(string searchString)
        {
            string result;

            if (string.IsNullOrEmpty(searchString))
            {
                result = null;
            }
            else
            {
                searchString = searchString.Replace("*", "%");
                searchString = Globals.StripHtmlXmlTags(searchString);
                searchString = Regex.Replace(searchString, "--|;|'|\"", " ", RegexOptions.Multiline | RegexOptions.Compiled);
                searchString = Regex.Replace(searchString, " {1,}", " ", RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.Compiled);
                result       = searchString;
            }
            return(result);
        }