I would try a petern like this: $pattern="!<a href='([^>]*)'>([^<]*)</a>!"
check the docs for greedy not greedy thingy... Mohamed~ On Mon, 2003-10-13 at 06:27, Justin French wrote: > 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php