[pmwiki-users] Re: some regex help

V.Krishn mistyfire at autograf.pl
Tue Sep 13 12:32:36 CDT 2005


On Tuesday 13 September 2005 19:33, Patrick R. Michaud wrote:
> On Tue, Sep 13, 2005 at 09:00:12AM -0500, Patrick R. Michaud wrote:
> > On Tue, Sep 13, 2005 at 07:47:33PM +0530, V.Krishn wrote:
> > > Hello,
> > > I was wanting to check a variable say - $myvariable
> > > for the following :
> > >
> > > "if the variable is a single word having only upper and/or lower case
> > > letters"
> > >
> > > Some help would be great.
> >
> >     /^[[:alpha:]]+$/
>
> More precisely:
>
>     if (preg_match('/^[[:alpha:]]+$/', $myvariable)) { ... }
Thanks :-) , I think this saved me couple of hours.
I just updated cookmenu recipe using the above code.
http://www.insteps.net/notebook2/channel.php/Cookbook/CookMenu

Hope this recipe is useful.
Regards.
V.Krishn
>
> Pm




More information about the pmwiki-users mailing list