Re: Re[2]: [PEAR-DEV] Tip to devs regarding Changelog and comments in bug system
| From: | Helgi Þormar | Date: | Wed, 10 Nov 2004 11:42:48 +0000 |
| Subject: | Re: Re[2]: [PEAR-DEV] Tip to devs regarding Changelog and comments in bug system | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev php.pear.webmaster |
| Request: | Send a blank email to pear-dev+get-34284@lists.php.net to get a copy of this message | ||
On Wed, 2004-11-10 at 11:05, TiP wrote:
> 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);
>
> ?>
Well I just made this:
$text = preg_replace('/(bug |#)([0-9]+)/', '<a
href="/bugs/\\2">\\0</a>', $text);
This should do both, but I don't want to exclude bugs which have the id
between 1-9 :)
--
Regards
Helgi