你能告诉我它是否可以Regex.Split
通过结束标签应用/>
。例如,有一行:
<area shape="poly" coords="464, 1415, 554, 1414, 741, 1415, 786, 1426, 792, 1464, 706, 1481, 592, 1477, 499, 1475, 438, 1457, 448, 1426" /><area shape="rect" coords="154, 581, 791, 694" />
在 c# 中获取字符串数组作为输出:
[0]:"<area shape="poly" coords="464, 1415, 554, 1414, 741, 1415, 786, 1426, 792, 1464, 706, 1481, 592, 1477, 499, 1475, 438, 1457, 448, 1426" />"
[1]:"<area shape="poly" coords="414, 1215, 154, 1414, 441, 1415, 786, 426, 792, 1464, 706, 1481, 592, 1477, 499, 1475, 438, 1457, 448, 1426" />"
试过:
const string pattern = "<area.*?>";
string[] result = Regex.Split(areaCodeHtml, pattern).ToArray();
不工作