关于 "正则" 的小问题。求解答
[解决办法]
public static string[] GetHtmlImageUrlList(string sHtmlText)
{
string pattern = "(?is)<CODE>(?<code>.*?)</CODE>.*?<DES>(?<des>.*?)</DES>";
Regex regImg = new Regex(pattern, RegexOptions.IgnoreCase);
MatchCollection matches = regImg.Matches(sHtmlText);
string[] result = new string[2];
foreach (Match match in matches)
{
result[0] = match.Groups["code"].Value.ToString();
result[1] = match.Groups["des"].Value.ToString();
}
return result;
}