preg_replace newb
| From: | Justin French | Date: | Mon, 13 Oct 2003 10:27:30 +0000 |
| Subject: | preg_replace newb | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-165948@lists.php.net to get a copy of this message | ||
Hi,
Trying to get this working, without any luck:
$str = preg_replace("!<a href='(.*?)'>(.*?)</a>!",'{link|\\2|\\1}',$str);
FWIW, I'm aware that this doesn't ANY WHERE NEAR cover all instances of a link, but in this case, I KNOW that the link will have the above format, because it was generated by another PHP script I wrote.
Any hints?
Justin