在我的XML中,我想搜索Text =“如果它不存在,那么我想要这样做
XMLString = Regex.Replace(XMLString,@"(?<=<Run[^<]*)>", " Text=\"",RegexOptions.IgnoreCase);
现在正则表达式在整个XML中找到Text =“
答案 0 :(得分:1)
if (Regex.IsMatch(XMLString," Text=\"")==false)
XMLString = Regex.Replace(XMLString,@"(?<=<Run[^<]*)>", " Text=\"",RegexOptions.IgnoreCase);