-1
我有一个字符串是这样的:C#正则表达式替换为自定义的JSON路径
Books[?(@.Author=='auth1 or auth2' or @.Author=='auth3 or auth4' or @.Author=='auth5 or auth6')].Revision
我需要的输出如下使用Regex.Replace:
Books[?(@.Author=='auth1 or auth2' || @.Author=='auth3 or auth4' || @.Author=='auth5 or auth6')].Revision
我尝试使用Regex.Replace(string, @"(?<filter>@\..*) or @", "${filter} || @")
。但输出结果如下:
Books[?(@.Author=='auth1 or auth2' or @.Author=='auth3 or auth4' ||
@.Author=='auth5 or auth6')].Revision
现在工作。非常感谢! “?=”是什么意思? – quldude