Thx! On 26 Jul., 15:50, Gábor Fási <[email protected]> wrote: > It works, your expression is wrong. Try '/^[a-zA-Z]{1,}[a-zA-Z0-9]$/'. > > On Mon, Jul 26, 2010 at 15:34, [email protected] <[email protected]> wrote: > > Hi! > > > In my app i am using sfGuardPlugin. I have extended the class > > sfGuardUserForm to build my own registration form class. In the > > overridden configure method I have code below to define the rules for > > the username: > > > $this->setValidator('username', > > new sfValidatorAnd( > > array( > > new sfValidatorString( > > array( > > 'required' => true, > > 'max_length' => 64, > > 'min_length' => 4 > > ), > > array( > > 'invalid' => "The username isn't available.", > > 'required' => 'Please enter a username.', > > 'max_length' => 'The username can not be longer than > > %max_length% characters.', > > 'min_length' => 'The username can not be shorter than > > %max_length% characters.' > > ) > > ), > > new sfBlacklistValidator( > > array('listed_error' => "The username '%value%' isn't > > available." ) > > ), > > new sfValidatorRegex( > > array( > > 'pattern' => '/[a-zA-Z]{1,}[a-zA-Z0-9]/' > > ), > > array( > > 'invalid' => "Your username isn't valid. Please start with a > > character and use characters from a to z and numbers only." > > ) > > ) > > ) > > ) > > ); > > > I want the username to begin with an character followed by any number > > of characters ot numbers, but the RegexValidator doesn't seen to work, > > because I can register the username "0aaaa" which is starting with a > > zero. > > > Any ideas what I am doing wrong? > > > regards, > > > michael > > > -- > > If you want to report a vulnerability issue on symfony, please send it to > > security at symfony-project.com > > > You received this message because you are subscribed to the Google > > Groups "symfony users" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group at > >http://groups.google.com/group/symfony-users?hl=en
-- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
