Re[2]: [PEAR-DEV] Tip to devs regarding Changelog and comments in bug system
| From: | TiP | Date: | Wed, 10 Nov 2004 11:05:40 +0000 |
| Subject: | Re[2]: [PEAR-DEV] Tip to devs regarding Changelog and comments in bug system | ||
| References: | 1 2 3 | Groups: | php.pear.dev php.pear.webmaster |
| Request: | Send a blank email to pear-dev+get-34283@lists.php.net to get a copy of this message | ||
Hello Helgi,
From Wednesday, November 10, 2004, 5:57:19 AM, you wrote:
HЮ> On Tue, 2004-11-09 at 18:28, TiP wrote:
>> Hello Helgi,
>>
>> HЮ> as people can notice by looking at my latest commit to pearweb, that now
>> HЮ> in changelogs and bug system comments, #343 is converted into <a
>> href="/bugs/343">>#343</a>
>>
>> $text = preg_replace('/#([0-9]+)/', '<a
>> href="/bugs/\\1">#\\1</a>', $text);
>> how about to add
>> $text = preg_replace('/bug ([0-9]{2,})/', 'bug <a
>> href="/bugs/\\1">#\\1</a>', $text);
>> also just in case smb. forget about #
>> ?
HЮ> What you proposed didn't work (the code) but I might look into it later
HЮ> on.
Didn't work for bugs with less than two digits in numbers to avoid
possible confusion.
<?php
$text = <<<HERE
look into bug 3
HERE;
echo $text = preg_replace('/bug ([0-9]{2,})/', 'bug <a
href="/bugs/\\1">#\\1</a>', $text);
$text = <<<HERE
look into bug 32 3
HERE;
echo $text = preg_replace('/bug ([0-9]{2,})/', 'bug <a
href="/bugs/\\1">#\\1</a>', $text);
?>
--
TiP