正则匹配大串中的所有小串
作者:高景洋 日期:2015-02-06 15:23:54 浏览次数:3490
Match m = Regex.Match(priceHtml, "\"price\":\"\\d+.\\d+\"", RegexOptions.Compiled | RegexOptions.IgnoreCase);
while (m.Value.Trim() != string.Empty)
{
decimal p = m.Value.Replace("\"price\":\"",string.Empty).Replace("\"",string.Empty).ToDecimal();
if (p > 0)
prices.Add(p);
m = m.NextMatch();
}
while (m.Value.Trim() != string.Empty)
{
decimal p = m.Value.Replace("\"price\":\"",string.Empty).Replace("\"",string.Empty).ToDecimal();
if (p > 0)
prices.Add(p);
m = m.NextMatch();
}
本文永久性链接:
<a href="http://r4.com.cn/art65.aspx">正则匹配大串中的所有小串</a>
<a href="http://r4.com.cn/art65.aspx">正则匹配大串中的所有小串</a>
当前header:Host: r4.com.cn
X-Host1: r4.com.cn
X-Host2: r4.com.cn
X-Host3: 127.0.0.1:8080
X-Forwarded-For: 3.22.75.247
X-Real-Ip: 3.22.75.247
X-Domain: r4.com.cn
X-Request: GET /art65.aspx HTTP/1.1
X-Request-Uri: /art65.aspx
Connection: close
Accept: */*
User-Agent: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Accept-Encoding: gzip, br, zstd, deflate