我希望你能协助处理正则表达式模式。
我有一个字符串:
test = "/*testing 1*/Name: /*Testing 2*/ My Name"
我需要从字符串中删除每个/**contents **/
。
我正在使用以下代码使用正则表达式进行过滤:
Regex rx = new Regex(@"/\*[^>]+\*/");
Template = rx.Replace(Template, match => { return String.Empty; });
但是我得到的结果只有"My Name",期望的结果是"Name: My Name"。