Hey guys.
This is an issue with my regex and I can't understand why!
Every single BB code I have works perfectly, except the last one [title=blue]Title[/title]Code:$format_search = array( '#\[b\](.*?)\[/b\]#is', '#\[i\](.*?)\[/i\]#is', '#\[u\](.*?)\[/u\]#is', '#\[s\](.*?)\[/s\]#is', '#\[quote\](.*?)\[/quote\]#is', '#\[size=([1-9]|1[0-9]|20)\](.*?)\[/size\]#is', '#\[color=\#?([A-F0-9]{3}|[A-F0-9]{6})\](.*?)\[/color\]#is', '#\[url=((?:ftp|https?)://.*?)\](.*?)\[/url\]#i', '#\[url\]((?:ftp|https?)://.*?)\[/url\]#i', '#\[title=(.*?)\](.*?)\[/title\]#i' ); $format_replace = array( '<strong>$1</strong>', '<em>$1</em>', '<span style="text-decoration: underline;">$1</span>', '<span style="text-decoration: line-through;">$1</span>', '<blockquote>$1</blockquote>', '<span style="font-size: $1px;">$2</span>', '<span style="color: #$1;">$2</span>', '<a href="$1">$2</a>', '<a href="$1">$1</a>', '<div class="box_header" id="$1"><center>$2</center></div>' ); $str = preg_replace($format_search, $format_replace, $str); $str = nl2br($str); return $str;
I don't see the problem, can anyone help?
Thanks in advance!



Reply With Quote


