Jump to content

delimeter escape error


darkfreaks

Recommended Posts

              
  $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? :confused:

Link to comment
https://forums.phpfreaks.com/topic/263679-delimeter-escape-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.