【发布时间】:2012-06-12 06:34:19
【问题描述】:
您好,我正在尝试使用来自
的解决方案Find all pattern indexes in string in C#
但是,在我的情况下它不起作用
string sentence = "A || ((B && C) || E && F ) && D || G";
string pattern = "(";
IList<int> indeces = new List<int>();
foreach (Match match in Regex.Matches(sentence, pattern))
{
indeces.Add(match.Index);
}
它会产生错误,“解析”(“ - 不够)”。
我不确定我在这里做错了什么。
感谢任何帮助。
谢谢,
巴兰辛尼亚
【问题讨论】: