Gossamer Forum
Home : General : Perl Programming :

$scores =~ s/???//sg;

Quote Reply
$scores =~ s/???//sg;
Hi there

I have html page, which I would like to extract info from.
It has baseball scores and lots of html junk between the data (and sometimes its not same html ie font size and others keep changing).
If I can figure out, how to extract just few numbers, I will be fine. Data always comes up as a:

wins^losts^ties and its always something between 0 and up to three digit number 104^78^8 or 0^8^0

How do I build the code? It should be just one line right?

Something like: $scores =~ s/(.*?.).^.(.*?.).^.(.*?.)/Wins:$1 Losts:$2 Ties:$3/sg;

How do I add a code to limit to only get the record if its up to three digit number?
Since page has sometimes has "^" mark somewhere else on the page to list something else.Crazy
Subject Author Views Date
Thread $scores =~ s/???//sg; Suomi 6594 Oct 22, 2002, 11:53 AM
Thread Re: [Suomi] $scores =~ s/???//sg;
Andy 6477 Oct 23, 2002, 2:36 AM
Thread Re: [Andy] $scores =~ s/???//sg;
Paul 6496 Oct 23, 2002, 2:57 AM
Post Re: [Paul] $scores =~ s/???//sg;
Suomi 6419 Oct 24, 2002, 8:20 PM
Thread Re: [Paul] $scores =~ s/???//sg;
Suomi 6263 Oct 21, 2004, 11:28 PM
Thread Re: [Suomi] $scores =~ s/???//sg;
Andy 6300 Oct 22, 2004, 2:25 AM
Post Re: [Andy] $scores =~ s/???//sg;
Suomi 6239 Oct 22, 2004, 8:53 AM