>Hi, > >I try to refer to the '<' character in a regex using preg_replace >function: > >preg_replace("/(http:\/\/.\S+(?<![\<\>]))/", "<a href=\"$1\" >target='ext'>$1</a>", "http://test<br>");
PHP needs a \\ just to get a single \, and Regex needs a single \ in front of the <. Thus, you need \\< so that PHP hands \< to Regex and keeps Regex happy. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php