Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

regex question

by Win (Novice)
on Dec 24, 2009 at 11:35 UTC ( [id://814214]=perlquestion: print w/replies, xml ) Need Help??

Win has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: regex question
by ww (Archbishop) on Dec 24, 2009 at 11:55 UTC

      I think regex are tough beans.
      But I agree that the OP could have tried first, and given some example code asked for help with his solution,
      rather than asking others for doing the work ...


      MH

        "But I agree that the OP could have tried first, and given some example code asked for help with his solution, rather than asking others for doing the work ..."

        Are you familiar with any of their previous posts? Lower your expectations.

Re: regex question
by JavaFan (Canon) on Dec 24, 2009 at 11:49 UTC
    The *easiest*? How about:
    m!\Qhttp://www.a_site.com/pubs.asp?ID=999582!
    but I bet that isn't really what you want.
Re: regex question
by Anonymous Monk on Dec 24, 2009 at 11:50 UTC
Re: regex question
by gmargo (Hermit) on Dec 24, 2009 at 11:55 UTC
    my $str = qq(<div class="rightbox8"> <p style="text-align: center"><st +rong><a href="http://www.a_site.com/pubs.asp?ID=999582">Please click +here to view</a></strong></p>); if ($str =~ /href="([^"]+)"/) { print "href=$1\n"; }
Re: regex question
by spadacciniweb (Curate) on Dec 24, 2009 at 12:06 UTC
    I suppose your href is always equal ('<a href="url"').
    $line = '<div class="rightbox8"> <p style="text-align: center"><strong +><a href="http://www.a_site.com/pubs.asp?ID=999582">Please click here + to view</a></strong></p>'; if ($line =~ /^.+<a href="(.+)".+/) { print $1; }

    Mariano

    (($_="Mzz ojjdloobnf jt uvy5502383")=~y~b-zg2-5c96-81~a-z0-9~s)=~s~~~s; print

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://814214]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-19 02:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found