原来写过的一些正则表达式,记录下来。。

                //<title>千纤草玫瑰纯露的评价怎么样|评论|心得|点评-还不错啦-闺蜜网</title>
                Match mat0 = Regex.Match(page, "<title>(.*)的评价怎么样\\|评论\\|心得\\|点评\\-(.*)\\-闺蜜网</title>", RegexOptions.IgnoreCase | RegexOptions.Multiline);
                //<br><a href=http://home.kimiss.com/member/594964/ target='_blank'>暮云儿</a>
                Match mat1 = Regex.Match(page, "<br><a href=http://home.kimiss.com/member/.*/ target='_blank'>(.*)</a>", RegexOptions.IgnoreCase | RegexOptions.Multiline);
                //<span class=hui><br>(海外-澳大利亚)</span></div><div class='font3 hui z2'>敏感混合性皮肤<br>混合性发质<br>年龄:20-25</div>      </div><!--inner_left-->
                Match mat2 = Regex.Match(page, "<span class=hui><br>\\((.*)\\)</span></div><div class='font3 hui z2'>(.*)<br>(.*)<br>年龄:(.*)</div>      </div><!--inner_left-->", RegexOptions.IgnoreCase | RegexOptions.Multiline);
                //<div class="title" id="title_861638"><h1>自带的刷子超级容易上色</h1></div>
                Match mat3 = Regex.Match(page, "<div class=\"title\" id=\"title_.*\"><h1>(.*)</h1></div>", RegexOptions.IgnoreCase | RegexOptions.Multiline);
                //src=http://statics1.kimiss.com/images/star200new.gif width="84">(较差)<DIV class=hui>
                Match mat4 = Regex.Match(page, "src=http://statics1.kimiss.com/images/star.*new.gif width=.*>[\\s\\S]*\\((.*)\\)[\\s\\S]*<DIV class=hui>", RegexOptions.IgnoreCase | RegexOptions.Multiline);
                //<div class=hui>时间:2011-02-23</div><span class=td1>
                Match mat5 = Regex.Match(page, "<div class=hui>时间:(.*)</div><span class=td1>", RegexOptions.IgnoreCase | RegexOptions.Multiline);
                //_type5>亲友赠送</span> <SPAN id=info_861638_type6>
                //_type5>网上购买</span><span id=info_865143_type6>
                Match mat6 = Regex.Match(page, "info_.*_type5>(.*)</span>.*<SPAN id=info_.*_type6>", RegexOptions.IgnoreCase | RegexOptions.Multiline);
                //<div class=hui>时间:2011-02-24</div><span class=td1>我的购买方式:</span><span id=info_866444_type5>网上购买</span> <span id=info_866444_type6>29元500ml</span>
                Match mat7 = Regex.Match(page, "<div class=hui>时间:(.*)</div><span class=td1>我的购买方式:</span><span id=info_.*_type5>(.*)</span> <span id=info_.*_type6>", RegexOptions.IgnoreCase | RegexOptions.Multiline);
                //<span id=info_779636_type1>也不知道为什么买散粉<div style='width:1px;height:1px;overflow:hidden;float:left;'>摘自闺蜜网</div>,至今搁置。<br/>但是有点小闪还不错。没事追求裸妆的时候 扫上它。    </span>
                //<span id=info_865159_type1>虽然没用多长时间,大<div style='width:1px;overflow:hidden;height:1px;float:left;'>你来过闺蜜网吗</div>概2个礼拜吧,没感觉,而且还贵,不打算再购入。    </span>
                Match mat8 = Regex.Match(page, "<span id=info_.*_type1>([\\s\\S]*)<span id=info_.*_type2>", RegexOptions.IgnoreCase | RegexOptions.Multiline);
                string content = mat8.Groups[1].Value;
                Match matx;
                for (int i = 1; i < 5; i++)
                {
                    matx = Regex.Match(content, "<div[^\u4e00-\u9fa5]*;'>", RegexOptions.IgnoreCase | RegexOptions.Multiline);
                    if (matx.ToString() == "")
                        break;
                    content = content.Replace(matx.ToString(), "");
                }

                //id=info_861638_type2>自带的刷子虽然硬,但很容易把腮红刷下来,所以注意上脸轻一些就行了。</SPAN><BR><SPAN 
                Match mat9 = Regex.Match(page, "xxxx id=info_.*_type2>([\\s\\S]*)<span class='hui'>", RegexOptions.IgnoreCase | RegexOptions.Multiline);
                //class=td1>产品类型:</span><a href='http://key.kimiss.com/topic/yanying' target=_blank title="眼影/眼蜜/眼釉产品推荐,排行">眼影/眼蜜/眼釉</a></div>

                Match mat10 = Regex.Match(page, "class=td1>产品类型:</span><a[\\s\\S][^<]*>(.*)</a></div>", RegexOptions.IgnoreCase | RegexOptions.Multiline);

                string sql = "exec dbo.R03Insert '" + mat0.Groups[1].Value.Replace("'", "''") + "','"
                                                    + mat10.Groups[1].Value.Replace("'", "''") + "','"
                                                    + mat4.Groups[1].Value.Replace("'", "''") + "','"
                                                    + mat0.Groups[2].Value.Replace("'", "''") + "','"
                                                    + mat6.Groups[1].Value.Replace("'", "''") + "','"
                                                    + content.Replace("'", "''") + "','"
                                                    + mat9.Groups[1].Value.Replace("'", "''") + "','"
                                                    + mat1.Groups[1].Value.Replace("'", "''") + "','"
                                                    + mat5.Groups[1].Value.Replace("'", "''") + "','"
                                                    + mat2.Groups[1].Value.Replace("'", "''") + "','"
                                                    + mat2.Groups[2].Value.Replace("'", "''") + "','"
                                                    + mat2.Groups[3].Value.Replace("'", "''") + "','"
                                                    + mat2.Groups[4].Value.Replace("'", "''") + "','"
                                                    + m_uri.ToString().Replace("'", "''") + "'"
                                                    ;


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值