PERL提取txt中的URL(很菜鸟的问题 哈哈)

PERL提取txt中的URL(很菜鸟的问题 哈哈)

PERL提取txt中的URL(很菜鸟的问题 哈哈)
想从txt格式的文本中,提取想要的URL并输出屏幕
txt中的内容:
Tibco Developer
> COMPANY: Nihaki Systems, Inc.
> LOCATION: Austin, TX
> http://seeker.dice.com/jobsearch/servlet/JobSearch?rel_code=1102&op=302&type=14&dockey=xml/5/2/523f5cc7c8a9a2941a5d6a1c2612b20a@endecaindex&bb=0&source=13
>
> Perl Static Market Data Engineers
> COMPANY: Moss Search, Ltd.
> LOCATION: Chicago, IL
> http://seeker.dice.com/jobsearch/servlet/JobSearch?rel_code=1102&op=302&type=14&dockey=xml/4/f/4f69d65cb693a87e63fc3d429233a095@endecaindex&bb=0&source=13

代码:
#usr/bin/perl

open (src,'JobLink.txt')||die(" txt open error! \n");
open (dst,'>ok.txt')||die("error \n");
my @URLarray = <src>;

foreach $url (@URLarray)
{
#print $url;
if($result = $url=~/(\bhttp\:\/\/seeker.dice.com\/jobsearch\/servlet\/JobSearch\?)/)
{
#print dst ($1);
#print $url ;
print $1."\n";
#写入文件
#print dst ($1);
}
#my $line = $url
}

close (src);
close (dst);

本意是想要提取整个URL,但输出结果:
http://seeker.dice.com/jobsearch/servlet/JobSearch?
http://seeker.dice.com/jobsearch/servlet/JobSearch?

请高人指点!!!!!!!!!!!!!!!




   

#!/usr/bin/perl -w--us.
#!/usr/bin/perl -w
use strict;
open (src,'JobLink.txt')||die(" txt open error! \n");
open (dst,'>ok.txt')||die("error \n");
my @URLarray = <src>;
my $url;my $result;
foreach $url (@URLarray)
{
#print $url;
if($result = $url=~/(\bhttp\:\/\/seeker.dice.com\/jobsearch\/servlet\/JobSearch\?.*_.*=.*&.*=.*&.*=.*&.*=.*\/.\/.\/.*@.*&..=.&.*=.*)/)
{
#print dst ($1);
#print $url ;
print $1."\n";
#写入文件
#print dst ($1);
}
#my $line = $url
}

close (src);
close (dst);
丑陋的 正则,大家原谅,我这个技术也就只能献丑了。。不过貌似中间 =&可以用一个计数代替
很好使
帅呆了,高手,小的可研究了很久 啊 哈哈
谢谢了[CCB]2[/CCB]
匹配这个--(http:\/\/([.
匹配这个
(http:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?)
要是我的话:if($read=~/h.
要是我的话:if($read=~/^>http.*/) {print $read;}




   

[CCB]2[/CCB]看来我还得再.
[CCB]2[/CCB]看来我还得再努力才行
qzyfktally
ZOtU63 <a href="http://pfkesxsufnnh.com/">pfkesxsufnnh</a>, [url=http://fpmehannhcvt.com/]fpmehannhcvt[/url], [link=http://rxruusdbvzut.com/]rxruusdbvzut[/link], http://znwwrtrfxjsq.com/

[img]http://qearfoploxwy.com/[/img]
[COLOR=BLUE]URL:[/COLOR][url]qvFYGBzGdzuQsf[/url]
hhauxcctfgu
MlJifI <a href="http://zfnnxelefwhy.com/">zfnnxelefwhy</a>, [url=http://xpvmyqxlmors.com/]xpvmyqxlmors[/url], [link=http://yyuytdsyakvo.com/]yyuytdsyakvo[/link], http://rzuwugxystgt.com/

[img]http://htoskosyzhmg.com/[/img]
[COLOR=BLUE]URL:[/COLOR][url]btDPFkvEKy[/url]