Regex Help Needed (Perl)

Discussion in 'Programming' started by america2, Aug 20, 2006.

  1. #1
    I'm trying to parse through a web page. The first thing I care about is an attribute of a tag that says: id=f6

    I want to kill off everything from the beginning of the string up until f6.
    I have the web page contained in $_

    Here is my expression: $_ =~ s/.*?f6//;

    When I print $_ I am getting the entire webpage. What's wrong with my regex?
    Help! Thanks...
     
    america2, Aug 20, 2006 IP
  2. brandnewx

    brandnewx Peon

    Messages:
    988
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    0
    #2
    id\=(f6.*)
     
    brandnewx, Aug 21, 2006 IP
  3. blfast

    blfast Peon

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    s/.*?f6//s
     
    blfast, Jan 26, 2007 IP
  4. picouli

    picouli Peon

    Messages:
    760
    Likes Received:
    89
    Best Answers:
    0
    Trophy Points:
    0
    #4
    s/.*?(f6.*)/$1/

    Just my 0.2€, I haven't been doing Perl in a looong time...
     
    picouli, Jan 26, 2007 IP