hi there i am trying tom preg_replace on a string enclosed in brackets to
denote a dynamic link

$message = "[http://www.eletroteque.dyndns.org/index_html.php|Eletroteque
Multimedia]";
echo $message =
preg_replace("/((http(s?):\/\/)|(www\.))([\w\.]+)([\/\w+\.]+)([\|\w+\.]+)\b/
i", "<a href=\"http\\3://\\4\\5\\6\" target=\"_blank\">\\7</a>", $message);

the result would be |Electroteque , i need somehow to check for the stuff
within the [ ] , remove the | and return on the two words Electroteque
Multimedia for the second part of the replace any ideas ?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to