CodeIgniter Forums
Preg_replace error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Preg_replace error (/thread-47332.html)



Preg_replace error - El Forum - 12-04-2011

[eluser]Unknown[/eluser]
A PHP Error was encountered
Severity: Warning
Message: preg_replace() [function.preg-replace]: Unknown modifier '('
Filename: helpers/custom_helper.php
Line Number: 20

Code:
$text = preg_replace('([[:space:]()[{}])(www.[[email protected]:%_\+.~#?&//=]+)',
'<a href="http://\\\\2" class="oembed" target="_blank">\\2</a>', $text); #line 20

Disregard the other \\