C#无法转义正则表达式字符串中的引号

Eya*_*yal 2 c#

我试图使用正则表达式匹配引号,但我没有设法逃避它们@string- 我收到一个错误:

output = Regex.Replace(str, @"[\d-']", string.Empty);    // valid

output = Regex.Replace(str, @"[\d-'\"]", string.Empty);  // not valid!
Run Code Online (Sandbox Code Playgroud)

这个也行不通:

string str = "[\d-'\"]" // bad compile constant value!
Run Code Online (Sandbox Code Playgroud)

DLe*_*Leh 6

"在逐字字符串中转义a ,请使用"":

Regex.Replace(str, @"[\d-'""]", string.Empty);
Run Code Online (Sandbox Code Playgroud)