Как сделать чтобы только zip выкидывало через regexp

Discussion in 'PHP' started by alexdrn, 25 Jan 2010.

  1. alexdrn

    alexdrn Member

    Joined:
    21 Jul 2008
    Messages:
    41
    Likes Received:
    6
    Reputations:
    0
    PHP:
    $input "текст с ссылки";

      
    $regexp "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>";
      if(
    preg_match_all("/$regexp/siU"$input$matchesPREG_SET_ORDER)) {
        foreach(
    $matches as $match) {
          
    # $match[2] = link address
          # $match[3] = link text


      
    }
     
      }

    Вот нашел но он выводит и ссылки без zip
    как сделать чтобы только zip выкидывало
     
  2. Kaimi

    Kaimi Well-Known Member

    Joined:
    23 Aug 2007
    Messages:
    1,732
    Likes Received:
    809
    Reputations:
    231
    Попробуй замени *> на *zip['"]>
     
    _________________________
  3. Solker

    Solker Elder - Старейшина

    Joined:
    4 May 2006
    Messages:
    175
    Likes Received:
    53
    Reputations:
    18
    $input, хотя бы фрагмент приведи, в котором есть нужная ссылка.