读书人

怎么使用正则表达式提取文本中特定的链

发布时间: 2012-08-07 14:54:48 作者: rapoo

如何使用正则表达式提取文本中特定的链接?
从<table border=0 cellpadding=0 cellspacing=0 bgcolor=ffffff><tr><td><a href="http://www.xxx.com/scripts/runner.php?PA=241564&PHPSESSID=50bfsdfdfsdgfgg03" target=_sdf onclick="javascript:reloadpage(12)"><img src=http://www.xxx.com/scripts/runner.php?REDIRECT=http%3dsfdsfdf1uz0.gif&hash=0a4b2fdsf5e6b19b96513e alt="" border=0></a></td></tr></table>(s<br><br><table border=0 cellpadding=0 cellspacing=0 bgcolor=ffffff><tr><td><a href="http://www.xxx.com/scripts/runner.php?PA=2155&PHPSESSID=
的文本中提取

http://www.xxx.com/scripts/runner.php?PA=241564
http://www.xxx.com/scripts/runner.php?PA=2155



[解决办法]
^.*<a\s+href="(.*)[&].*<a\s+href="(.*)[&].*$

读书人网 >.NET

热点推荐