刚接触c#..我需要一些帮助..我正在尝试将其转换为C#,但不知道C#中preg_match_all的等价物是什么..正在阅读一些书,但我不明白..:'(
$pattern =
'@' .
'<td>\s*' .
'(?P<no>\d+)\.\s*' .
'</td>\s*' .
'<td>\s*' .
'<a class="LN" href="[^"]*+" onclick="[^"]*+">\s*+' .
'<b>(?P<name>[^<]*+)</b>\s*+' .
'</a>.*\s*' .
'</td>\s*+' .
'<td align="center">[^<]*+</td>\s*+' .
'<td>\s*+' .
'(?P<locations>(?:<a href="[^"]*+">[^<]*+</a><br />\s*+)++)' .
'</td>' .
'@'
;
$results = array();
preg_match_all($pattern, $contents, $matches, PREG_SET_ORDER);
foreach ($matches as $i => $match) {
preg_match_all('@<a href="[^"]*+">([^<]*+)</a>@', $match['locations'], $locations);
$results[$i]['no'] = $match['no'];
$results[$i]['name'] = $match['name'];
$results[$i]['locations'] = $locations[1];
}**