Re: Regexp to match an URL in an HTML <a href=""></a> tag

From: Gunnar Hjalmarsson (noreply_at_gunnar.cc)
Date: 11/15/03

  • Next message: Andy R: "Re: Regexp to match an URL in an HTML <a href=""></a> tag"
    Date: Sat, 15 Nov 2003 05:29:20 GMT
    
    

    Charles Nadeau wrote:
    > I am trying to craft a regular expression to filter an URL from a
    > tag and the one I have doesn't seen right. I use
    > the regular expression from this snippet of code:
    >
    > foreach my $message (@messages)
    > {
    > my @match=($message->decoded=~/\bhref="(http.*)">.*/gi);
    >
    > foreach my $match(@match)
    > {
    > print $match,"\n";
    > }
    >
    > }
    >
    > but it doesn't lead to results that are exactly what I need.

    http://theoryx5.uwinnipeg.ca/CPAN/perl/pod/perlfaq9/How_do_I_extract_URLs.html

    -- 
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    

  • Next message: Andy R: "Re: Regexp to match an URL in an HTML <a href=""></a> tag"

    Relevant Pages

    • Re: Regexp to match an URL in an HTML <a href=""></a> tag
      ... > I am trying to craft a regular expression to filter an URL from a <a ... > I use the regular expression from this snippet of code: ...
      (comp.lang.perl)
    • Re: Everybody is out of step (including the Looney Zealot) but...
      ... Has anybody come up with a filter string for Agent that will reliably ... ".*" means match zero or more characters before the next character. ... If she tries some BS like cArOlInE, this very paranoid regular expression will ... What I REALLY wish is that Agent included some sort of semantic analysis, ...
      (rec.outdoors.rv-travel)
    • Re: Yipee! .. theyre gone ...
      ... on LinuxMINT), I'm using a filter which successfully deleted all the ... In case anyone is interested in trying the same, the filter uses ... Regular Expression, and is given below. ... header matches any message crossposted to 4 or more ...
      (uk.people.silversurfers)
    • Re: 40tude Dialog (regex query): How to test for no vowels in Subject?
      ... the above filter for scoring but it didn't work. ... So I verified that the regular expression did indeed work. ... Do I need to use regular expressions in the group specifier, too, like ... how come the asterisk works by itself instead of having to use ...
      (news.software.readers)
    • Re: MTR Moderated? Perhaps its time has come.
      ... know of a regular expression that will filter out the "Chinese ... spam", I'd love to hear about it. ...
      (misc.transport.road)