Re: Re: Tip to devs regarding
| From: | Justin Patrin | Date: | Wed, 10 Nov 2004 17:11:29 +0000 |
| Subject: | Re: Re: Tip to devs regarding | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.pear.dev php.pear.webmaster |
| Request: | Send a blank email to pear-dev+get-34290@lists.php.net to get a copy of this message | ||
On Wed, 10 Nov 2004 13:27:31 +0100, Michael Wallner <mike@php.net> wrote:
> 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
>
Just in case...
/(bug:?|#)[^\S\n\r]*(\d+)/i
--
paperCrane --Justin Patrin--