regular expression all urls but those containing images ...

New to mod_rewrite? This is a good place to start.

regular expression all urls but those containing images ...

Postby hax » Thu Jun 09, 2005 3:20 am

since my head is about to explode maybe someone can help me:

I want to look for all urls except those that end with (.jpg|.gif|.png)


$prefix = '(http|https|ftp|telnet|news|gopher|file|wais)://';
$pureUrl = '([[:alnum:]/\n+-=%&:_.~?]+[#[:alnum:]+]*)';
$mygmsg = eregi_replace($prefix . $pureUrl, '<a
href="\\1://\\2" target="_blank"
class="normal">\\1://\\2</a>', $mygmsg);

here's what I'm doing no, but I want to replace images with something different .. :)
hax
 
Posts: 10
Joined: Sun Mar 13, 2005 4:03 pm

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 95 guests

cron