正则表达式提取網頁內容

正则表达式 | 2016-11-17 12:47:49 | 阅读 1682 次 | 评论(0)
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

文章评论,共0条
游客请输入验证码
浏览234490次
最新评论
  • cstdio:ooooooo
  • sdta:从VFP入手也不错
  • yuanhouwen:尊敬的sdta大神:作为一个编程外行,看到你关于操控EXCEL的编程程序我觉得特别神奇,想向你...