I created my own regex, and everything work fine except the backslash thing. I tried my versions, but none of them helped.
var regexItem = new Regex("[^A-Za-z0-9_.,&/*:;=+{}()'\"\\ -]+");
string temp2 = "";
while ((@line = file2.ReadLine()) != null)
{
if (regexItem.IsMatch(line) && (line.Contains(".jpg") || line.Contains(".png") || line.Contains(".jpeg") || line.Contains(".svg")))
{
@temp2 = Regex.Replace(line, "[^A-Za-z0-9_.,&/\\*:;=+{}()'\" -]+", "");
postki.WriteLine(@temp2);
Console.WriteLine(@"{0} ==> {1}", @line, @temp2);
}
else
{
postki.WriteLine(@line);
}
}