in reply to Working with source of returned web page

Is it that your web page has something like: <hr>34567<hr> and you want to extract the string 34567?

If so, this is just a simple regex match:

if ($response->content =~ m/<hr>(.*?)<hr>/) { $matched_number = $1; } else { # didn't find a match }
If this isn't what you need, a concrete example of what you are looking for would help.

Replies are listed 'Best First'.
Re^2: Working with source of returned web page
by tachyon-II (Chaplain) on Jun 09, 2008 at 20:59 UTC

    When using regexes to "parse" html it is often useful to use a negative character class instead of .*? as all the RE engine has to do is grab stuff up to the next tag. This will of course choke if closing tags are muddled.

    m/<tag>([^<]*)</tag>/
Re^2: Working with source of returned web page
by clone4 (Sexton) on Jun 09, 2008 at 20:07 UTC
    Stupid me, just couldn't get it, it's exactly what I needed.
    Well big thanks and I'm gonna revise regex a lot more...