preg help please :)
| From: | Justin French | Date: | Thu, 16 Oct 2003 04:23:45 +0000 |
| Subject: | preg help please :) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-166270@lists.php.net to get a copy of this message | ||
Hi,
I have the following:
<?
$quote = "̶[0|1]{1};";
$text = preg_replace(
"/$quote(.*)$quote:$quote(.*)$quote/",
"<a href='\\2'>\\1</a>",
$text
);
?>
It basically matches "link text":"url" with the added twist of having the quotes converted to “ or “ by a previous function.
It works fine if there is one link found inside a string, but falls over horribly if there's two links inside a string.
How can I improve the (.*) to exclude $quote ?
Thanks,
Justin French