neoform Posted May 12, 2008 Share Posted May 12, 2008 How can I modify this to exclude any string that contains "Image: as the first set of chars in the brackets? (this is for parsing Wikipedia's formatting) $str = preg_replace("`\[\[(.*)\]\]`siU", "<a href=\"\\1\">\\1</a>", $str); Quote Link to comment https://forums.phpfreaks.com/topic/105330-solved-url-vs-imageblah/ Share on other sites More sharing options...
effigy Posted May 12, 2008 Share Posted May 12, 2008 "`\[\[(?!Image:)(.*)\]\]`siU" Quote Link to comment https://forums.phpfreaks.com/topic/105330-solved-url-vs-imageblah/#findComment-539465 Share on other sites More sharing options...
neoform Posted May 12, 2008 Author Share Posted May 12, 2008 Nice thanks. Quote Link to comment https://forums.phpfreaks.com/topic/105330-solved-url-vs-imageblah/#findComment-539533 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.