darkfreaks Posted June 5, 2012 Share Posted June 5, 2012 $search = array("/\[b\](.*)\[\/b\]/Usi","/\[u\](.*)\[\/u\]/Usi","/\[i\](.*)\[\/i\]/Usi","/\[s\](.*)\[\/s\]/Usi", "(\[sub\](.+?)\[\/sub])is","(\[sup\](.+?)\[\/sup])is","\[mail\]([^\[\(\)']+)\[/mail\]", "/\[video\](.+?)\[\/video\]/e","/\[quote](.*)\[\/quote\]/Uis","/\[sc\](.*?)\[\/sc\]/i", "/\[center\](.*?)\[\/center\]/i"); $replace = array("<b>\\1</b>","<u>\\1</u>","<i>\\1</i>","<span style=\"text-decoration: line-through\">\\1</span>","<sub>$1</sub>", "<sup>$1</sup>","<a href=\"mailto:\\1\">\\1</a>,","embed_video('$1')", "<div>Quote:</div><div style=\"border:solid 1px;\">\\1</div>", "<font style=\"font-variant: small-caps\">\\1</font>","<div style=\"text-align:center\">\\1</div>"); $clean['comment'] = preg_replace($search,$replace,$clean['comment']); where am i not escaping the regex? or which regex could use some updating? Link to comment https://forums.phpfreaks.com/topic/263679-delimeter-escape-error/ Share on other sites More sharing options...
kicken Posted June 5, 2012 Share Posted June 5, 2012 "(\[sub\](.+?)\[\/sub])is","(\[sup\](.+?)\[\/sup])is","\[mail\]([^\[\(\)']+)\[/mail\]", Your second line of regex's have no delimiters in them at all. Link to comment https://forums.phpfreaks.com/topic/263679-delimeter-escape-error/#findComment-1351283 Share on other sites More sharing options...
darkfreaks Posted June 5, 2012 Author Share Posted June 5, 2012 must be blind tonight thanks will fix it ASAP! Link to comment https://forums.phpfreaks.com/topic/263679-delimeter-escape-error/#findComment-1351285 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.