PHP regex help needed

Discussion in 'PHP' started by guruguy, Oct 8, 2008.

  1. #1
    I am trying to use a regex to match a specific link from a ripped page. At the moment I have taken the following pattern from another script.

    $pattern = "#<a href=\"([^\">]+)\"[^>]*>#i";

    It works perfectly well at matching all links and the link I want is captured, however as regex's aren't my domain, I have no idea how to only match links that start with http://.subdomain.domain.com/etc/ or contains a specific sequence in the url. Could anyone lend a hand?
     
    guruguy, Oct 8, 2008 IP
  2. happpy

    happpy Well-Known Member

    Messages:
    926
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    120
    #2
    please give some example html-code and tell what is to rip.

    by your text it can be almost anything
     
    happpy, Oct 8, 2008 IP