Re: [SPAM] [PEAR] [QuickForm] My own validatio

From: Date: Wed, 08 Dec 2004 18:20:23 +0000
Subject: Re: [SPAM] [PEAR] [QuickForm] My own validatio
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-16119@lists.php.net to get a copy of this message
On Wed, 8 Dec 2004 14:08:47 +0100, Cédric Fournier <cfournier@itop.fr> wrote: > Hello, > > I try to add my own script validation on both client-side and server-side.. I > Made this regular expression : and add with registerRule. > > > $form->registerRule('is_alpha_cr','regex',"/^[a-zA-Z'éèêëàâäùüûôöîïç, > -\n]+$/"); Use single quotes for the regex '/^[a-zA-Z'éèêëàâäùüûôöîïç,-\n]+$/' > > My regular expression looking for a string where there'is only letters, > blank and new line (\ n). My problem is that when i'm looking on the source > the newline disappear from my expression and there's a real new line. I had > an extra backslash. It works with Javascript but not with php because of the > extra backslashes. > > Anybody have a solution to validate a text with regular expression ? > > Thanks. > -- Justin Patrin

« previous php.pear.general (#16119) next »