'/^[\-\'\.\sa-z]+$/i'
On Nov 29, 3:54 am, Stephen <step...@ninjacodermonkey.co.uk> wrote:
> My mistake, "i" goes after the forward slash.
>
> *'rule' => array('custom', '/^[\-\'\.\sa-zA-Z]+$/i'),*
>
> On 29 November 2010 08:53, Stephen <step...@ninjacodermonkey.co.uk> wrote:
>
>
>
>
>
>
>
>
>
> > Try adding an "i" to the end, this worked for me.
>
> > *'rule' => array('custom', '/^[\-\'\.\sa-zA-Z]+$i/'),*
>
> > On 29 November 2010 00:25, Dave Maharaj <m...@davemaharaj.com> wrote:
>
> >> Thanks,
>
> >> I have 'rule' => array('custom', '/^[\-\'\.\sa-zA-Z]+$/'),
>
> >> But the ' will not go thru.
>
> >> I know im an idiot......lol
>
> >> Dave
>
> >> -----Original Message-----
> >> From: Miles J [mailto:mileswjohn...@gmail.com]
> >> Sent: November-28-10 8:42 PM
> >> To: CakePHP
> >> Subject: Re: Common Punctuation
>
> >> Forgot spaces:
>
> >> /^[\-\.\sa-zA-Z]+$/
>
> >> On Nov 28, 4:08 pm, Miles J <mileswjohn...@gmail.com> wrote:
> >> > Off the top of my head:
>
> >> > /^[\-\.a-zA-Z]+$/
>
> >> > Regex is probably the easiest approach. Just set it as a custom
> >> > validation rule.
>
> >> > On Nov 28, 1:30 pm, "Dave Maharaj" <m...@davemaharaj.com> wrote:
>
> >> > > I know its not so much Cake question so forgive me ahead of time.
>
> >> > > But does anyone know a regex for common punctuation? I want to put
> >> > > validation on my "City" field where it's a-z and also allow ' - and .
> >> City
> >> > > should not have any numbers. Open to any other ideas that you have
> >> used
> >> also
> >> > > as I hate regex. I do not want people putting in crazy fake names.
> >> Almost
> >> > > impossible to verify the name they enter (imagine that db table of
> >> every
> >> > > possible name of every city / town in the world) so I would like to
> >> ensure
> >> > > its within the realm of being real.
>
> >> > > St.Louis has (.)
>
> >> > > St.John's (. And ' )
>
> >> > > And other have the - separating words of the name. Cant think of any
> >> else?
> >> > > Any help would be great.
>
> >> > > Thanks,
>
> >> > > Dave
>
> >> Check out the new CakePHP Questions sitehttp://cakeqs.organd help
> >> others
> >> with their CakePHP related questions.
>
> >> You received this message because you are subscribed to the Google Groups
> >> "CakePHP" group.
> >> To post to this group, send email to cake-php@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> cake-php+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.c om>For more options, visit this group at
> >>http://groups.google.com/group/cake-php?hl=en
>
> >> Check out the new CakePHP Questions sitehttp://cakeqs.organd help
> >> others with their CakePHP related questions.
>
> >> You received this message because you are subscribed to the Google Groups
> >> "CakePHP" group.
> >> To post to this group, send email to cake-php@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> cake-php+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.c om>For more options, visit this group at
> >>http://groups.google.com/group/cake-php?hl=en
>
> > --
> > Kind Regards
> > Stephen @ NinjaCoderMonkey
>
> > www.ninjacodermonkey.co.uk
>
> --
> Kind Regards
> Stephen @ NinjaCoderMonkey
>
> www.ninjacodermonkey.co.uk
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment