正则表达式提取網頁內容

作者在 2016-11-17 12:47:49 发布以下内容
Clear 
Text To s Noshow 
<tr class='citytr'><td><a href='23/2301.html'>230100000000</a></td><td><a href='23/2301.html'>哈尔滨市</a></td></tr><tr class='citytr'><td><a href='23/2302.html'>230200000000</a></td><td><a href='23/2302.html'>齐齐哈尔市</a></td></tr><tr class='citytr'><td><a href='23/2303.html'>230300000000</a></td><td><a href='23/2303.html'>鸡西市</a></td></tr><tr class='citytr'><td><a href='23/2304.html'>230400000000</a></td><td><a href='23/2304.html'>鹤岗市</a></td></tr><tr class='citytr'><td><a href='23/2305.html'>230500000000</a></td><td><a href='23/2305.html'>双鸭山市</a></td></tr><tr class='citytr'><td><a href='23/2306.html'>230600000000</a></td><td><a href='23/2306.html'>大庆市</a></td></tr><tr class='citytr'><td><a href='23/2307.html'>230700000000</a></td><td><a href='23/2307.html'>伊春市</a></td></tr><tr class='citytr'><td><a href='23/2308.html'>230800000000</a></td><td><a href='23/2308.html'>佳木斯市</a></td></tr><tr class='citytr'><td><a href='23/2309.html'>230900000000</a></td><td><a href='23/2309.html'>七台河市</a></td></tr><tr class='citytr'><td><a href='23/2310.html'>231000000000</a></td><td><a href='23/2310.html'>牡丹江市</a></td></tr><tr class='citytr'><td><a href='23/2311.html'>231100000000</a></td><td><a href='23/2311.html'>黑河市</a></td></tr><tr class='citytr'><td><a href='23/2312.html'>231200000000</a></td><td><a href='23/2312.html'>绥化市</a></td></tr><tr class='citytr'><td><a href='23/2327.html'>232700000000</a></td><td><a href='23/2327.html'>大兴安岭地区</a></td></tr>
Endtext
oRegExp=Createobject("VBScript.RegExp")
oRegExp.Global=.T.
oRegExp.Ignorecase=.F.
oRegExp.Pattern="[/\\:.<>a-zA-Z-=']"
ss=oRegExp.Replace(s,"")
oRegExp.Pattern="[0-9]+ "
SS=oRegExp.Replace(ss,"")
?ss
*=ALINES(amc,ss," ")
*LIST MEMORY LIKE amc

正则表达式 | 阅读 2408 次
文章评论,共0条
游客请输入验证码
浏览405499次