Need help with a regular expression

Discussion in 'PHP' started by schmidte, Jun 18, 2007.

  1. #1
    I found a script that is used to scrape Ask.com "related search" terms, it worked well until Ask.com changed it's user interface. The author of the script told me I needed to change the regular expression to get it to work again.

    The code is here

    The output would be something similar to this

    Here's a youtube video of the guy building the script

    If anyone has any suggestions, it would be greatly appreciated.
    Thanks in advance,
    ED
     
    schmidte, Jun 18, 2007 IP
  2. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #2
    Change:
    preg_match_all("/ec:'(.+?)'}\)\">(.+?)<\/a><\/td>/", $data, $keywords);
    PHP:
    To:
    preg_match_all("/ec:'(.+?)'}\)\"[^>]+>(.+?)<\/a><\/td>/", $data, $keywords);
    PHP:
     
    krt, Jun 18, 2007 IP
  3. schmidte

    schmidte Peon

    Messages:
    345
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #3
    That still didn't seem to work. Did you get it to output keywords when you tried it?
     
    schmidte, Jun 18, 2007 IP