Re: Tip to devs regarding
| From: | Michael Wallner | Date: | Wed, 10 Nov 2004 12:27:31 +0000 |
| Subject: | Re: Tip to devs regarding | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.pear.dev php.pear.webmaster |
| Request: | Send a blank email to pear-dev+get-34288@lists.php.net to get a copy of this message | ||
Hi Helgi Þormar, you wrote:
> On Wed, 2004-11-10 at 12:01, Martin Jansen wrote:
>
>>On Wed Nov 10, 2004 at 11:4248AM +0000, Helgi Þormar wrote:
>>
>>>$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 :)
>>
>>'/bug:? #?(\d+)/i' should work well.
>
>
> Ahh okey, well I'm no regex king as you should know :)
> Actually Mike told me to use \d first, but I replaced it with [0-9]
> since less knowing users about regex are more likely to understand it :)
> Anyway if you want to change it, then go ahead, I've nothing against it.
Well, while we're at it.... ;)
We could also use /(bug:?|#)[^\S\n]*(\d+)/i
Cheers,
--
Michael - < mike(@)php.net >
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc