coldfingertips has asked for the wisdom of the Perl Monks concerning the following question:
Which is taken from $lycos_content ($content is the source code dump of the page as taken from LWP::UserAgent).Showing Results <b>1 thru 4</b> of 4
The numbers will always be different. It could be 1 thru 7 of 7. But the results, if large, may have some number separators I have to watch out for, too.
From my count, there are 7 tabs after the URL and one space after that before the "1 of" begins. I need to match the total number in $1.
This is my attempt but sadly it fails
If you want to see first hand what the results look like, try going to http://search.lycos.com/default.asp?loc=searchbox&query=linkdomain%3Awww.test.comv .$lycos_content =~ |Showing Results <b>\d thru \d</b> of\s*\t* (\d[\d,] +*)|s; my $lycos_results = $1; if (!defined $lycos_results) { $lycos_results=0; }
Thank you.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regex to match Lycos results
by BrowserUk (Patriarch) on Jan 28, 2005 at 02:23 UTC | |
by coldfingertips (Pilgrim) on Jan 28, 2005 at 02:41 UTC |