我有包含此类文本的html
.......
<a class="product_name" href="index.php?productID=29785">Funny</a>
........
<a class="product_name" href="index.php?productID=29787">Very Funny</a>
......
Run Code Online (Sandbox Code Playgroud)
我想将属性值和文本href到链接中,所以我想得到
"index.php?productID=29785", "Funny"
"index.php?productID=29787", "Very Funny"
Run Code Online (Sandbox Code Playgroud)
而我用
MatchCollection mc = Regex.Matches(pageData,
"<a class=\"product_name\" href=\"(.+)\">(.+)</a>");
Run Code Online (Sandbox Code Playgroud)
为了这.但是当我调试代码时,我看到mc.Count = 0
我想我没有正确地逃脱报价,但我不知道.
| 归档时间: |
|
| 查看次数: |
102 次 |
| 最近记录: |