Regex nightmare:(
| From: | Tim Steele | Date: | Wed, 09 Jul 2003 15:07:47 +0000 |
| Subject: | Regex nightmare:( | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-154566@lists.php.net to get a copy of this message | ||
i need to uses reg ex to change <a href="url"> to <a href="url"
target=_blank>
the < brackets have to be represented using < and >
I have tried so many ways, but none work. here is an example of my
faliure.
$body =
preg_replace("/(href=\/?)(\w+)(>\/?)/e","'\\1'.'\\2'./'target=_blank/
'.'\\3'", $body);
Thanks