🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.ruby
Article #1060

jak przeczesać tekst i wyłuskać dane?

#1060
From: shaman
Date: Fri, 09 May 2008 08:21
17 lines
1137 bytes
Hi.. to mój pierwszy kontakt z Ruby. Wymyśliłem sobie na początek 
wyciąganie danych z htmla. Ale nie wiem jak się zmyślnie przesuwać po 
kolejnych dopasowaniach patternu.

może:
s = StringScanner.new(body);
while s.scan_until(/pattern/) do
   m = /pattern/.match(s.matched)
   puts m[1]
   puts m[2]
    ...
end

Nie podoba mi się to - jak to zrobić lepiej?

PZDR
Shaman
Technical Details
Message-ID: <g011hi$ihe$1@news.telbank.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.telbank.pl!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.telbank.pl!not-for-mail
From: shaman <noone@nowhere.com>
Newsgroups: pl.comp.lang.ruby
Subject: jak przeczesać tekst i
 wyłuskać dane?
Date: Fri, 09 May 2008 10:21:05 +0200
Organization: BPTNet - http://www.telbank.pl
Lines: 17
Message-ID: <g011hi$ihe$1@news.telbank.pl>
NNTP-Posting-Host: nc.kir.pl
Mime-Version: 1.0
X-Trace: news.telbank.pl 1210321266 18990 193.27.6.21 (9 May 2008 08:21:06 GMT)
X-Complaints-To: usenet@news.telbank.pl
NNTP-Posting-Date: 9 May 2008 08:21:06 GMT
User-Agent: Thunderbird 2.0.0.14 (Windows/20080421)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit