AV1611 Posted October 11, 2008 Share Posted October 11, 2008 $pattern=array( "/\[link\](.*?)\[\/link\]/" ); $replace=array( "<a href=\"\\1\">\\1</a>" ); $str=preg_replace($pattern,$replace,$mystring); This is working good, but... How can I make the $pattern part case insensitive? Link to comment https://forums.phpfreaks.com/topic/128004-solved-quick-preg_replace-question/ Share on other sites More sharing options...
wildteen88 Posted October 11, 2008 Share Posted October 11, 2008 by using the i pattern modifier. "/\[link\](.*?)\[\/link\]/i" Link to comment https://forums.phpfreaks.com/topic/128004-solved-quick-preg_replace-question/#findComment-662830 Share on other sites More sharing options...
AV1611 Posted October 11, 2008 Author Share Posted October 11, 2008 Thanks, That did the trick. Can anyone point me to a good NOOB tutorial? I STILL can't get my head around regex Link to comment https://forums.phpfreaks.com/topic/128004-solved-quick-preg_replace-question/#findComment-662916 Share on other sites More sharing options...
GingerRobot Posted October 11, 2008 Share Posted October 11, 2008 There should be one available on this site before too long. Link to comment https://forums.phpfreaks.com/topic/128004-solved-quick-preg_replace-question/#findComment-662919 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.