Re: - ereg_replace
| From: | David T-G | Date: | Fri, 14 Nov 2003 11:24:41 +0000 |
| Subject: | Re: - ereg_replace | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-31575@lists.php.net to get a copy of this message | ||
Hi!
..and then ÍÉÊÏÓ ÃÁÔÓÇÓ said...
%
..
% ereg_replace("^<a href=\"([:alnum:])\">$", "<a
href=\"\\1\"
% target=\"_blank\">", $string)
%
% I echo the result but nothing changing.
% What Im doing wrong?
Is your string really the only thing on a line, or could it be anywhere
in the input? The ^ (beginning) and $ (ending) anchors are probably
messing you up.
If your format *is* like this, you could do a quick
preg_replace('/>$/',' target="_blank">',$string)
(untested) and be done with it :-)
% Thanx
HTH & HAND
:-D
--
David T-G * There is too much animal courage in
(play) davidtg@justpickone.org * society and not sufficient moral courage.
(work) davidtgwork@justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur
Pbzzhavpngvbaf Qrprapl Npg!