日期:2014-05-16 浏览次数:21033 次
string sInput = File.ReadAllText(@"C:\Users\myx\Desktop\Test.txt", Encoding.GetEncoding("GB2312"));
string pattern = @"(?i)<td[^>]*?>(\d+(?:\.\d+)?)</td>\s*?<td[^>]*?ref=(['""]?)([^'""]*?)\2[^>]*?>([^<>]*?)</td>\s*?<td[^>]*?>([^<>]*?)</td>";
Match m = Regex.Match(sInput, pattern);
string v1 = m.Groups[1].Value;//"1.905"
string v2 = m.Groups[3].Value;//"2.020"
string v3 = m.Groups[4].Value;//"成本/售价"
string v4 = m.Groups[5].Value;//"3.925"