preg_replace quandry

    Date: 11/30/07 (PHP Community)    Keywords: web

    I'm trying to remove any of the below hyperlinks that do not contain "video/" or "print/" in the href attribute. However, I cannot figure out what else to put into the expression so it works.

    $text = '

    View Winning Marketing Material

    View Winning Website

    View Winning video

    ';

    echo preg_replace('/[^<]*?<\/a>/', '', $text);

    Source: http://community.livejournal.com/php/600508.html

« RegEx Stoopid || Variable Functions w/... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home