From: RaymondLHW Date: 2003-03-21T10:00:45+09:00 Subject: Re: How to process a long string ( get some parts ? ) text.scan ........ let me try thank you : ) "Robert Klemme" wrote in message news:b5cv74$28okso$2@ID-52924.news.dfncis.de... > Administrator@BOND ~/bin/test > $ cat href.rb > > def links(fileName) > text = File.open(fileName) do |f| > f.readlines.join > end > > text.scan(/ puts m[0] > end > end > > links("href.rb") > > __END__ > > > > Administrator@BOND ~/bin/test > $ ruby href.rb > http://foo.bar > http://foo.baz > > Administrator@BOND ~/bin/test > $ > > "RaymondLHW" schrieb im Newsbeitrag > news:b5cri9$27p391$1@ID-157330.news.dfncis.de... > > if I get the content of a HTML file and put in a string > > how can I get all the links inside and store them in array ( or any kind > of lists ) ? > > > > I use regular expression , but if I use .match function, the result is > "Match" type , I can't use "gsub" or "sub" to process it > > > > please give me some advice > > > > thank you >