Jump to content

Warning: preg_replace(): Unknown modifier '('


terungwa

Recommended Posts

$text = preg_replace("/([^[])/me([^\n\r$]*)([\n\r$])/", "\\1<span class=\"me\">*".$ubbObj->username." \\2 *</span>\\3", $text); 
  $text = nl2br($text);
$text = preg_replace("([^[])/me([^\n\r$]*)([\n\r$])", "\\1[me=".$this->username."]\\2[/me]\\3", $text);

I was editing the code bit above (converting eregi_replace to preg_replace) but i am getting a warning: Warning: preg_replace(): Unknown modifier '('

could you help me resolve the right regex synthax.

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/287681-warning-preg_replace-unknown-modifier/
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.