I'm using the following regex:
documentText = Regex.Replace(documentText, "\\\\|\\^|\\+|\\*|~|#|=|\"", "");
and it works. But when I split this string by using:
wordsInText = documentText.ToLower().Split(' ').ToList();
I get elements that are marked as "" (empty string). I can remove it manually by iterating through collection and removing empty elements, but it must be a way to prevent this weird behaviour.
documentTextdidn't contain consecutive blanks but after replacing it does? Then just use the regex string"(\\\\|\\^|\\+|\\*|~|#|=|\") ?"instead@"\\|\^|\+|\*|~|#|=|"""