[pmwiki-users] Re: some regex help

Patrick R. Michaud pmichaud at pobox.com
Tue Sep 13 09:03:35 CDT 2005


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)) { ... }

Pm




More information about the pmwiki-users mailing list