Re: Regular expression in Router::connect
On 15.05.2007 02:50 Aaron Shafovaloff wrote: > I figured it out: > > Router::connect('/:group/:curriculum/*', > array('controller'=>'curriculum'),array('curriculum'=>'\b(?:(?! > curriculum|courses|facilitators|configuration)\w)+\b')); Your parens are off. The negative lookahead assertions should group all the alternatives, so try: \b(?!(?:curriculum|courses|facilitators|configuration))\w+\b -Matt --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Regular expression in Router::connect
Hr turns out that doesn't really work. I give up. On May 14, 6:50 pm, Aaron Shafovaloff <[EMAIL PROTECTED]> wrote: > Wooo hoo! > > I figured it out: > > Router::connect('/:group/:curriculum/*', > array('controller'=>'curriculum'),array('curriculum'=>'\b(?:(?! > curriculum|courses|facilitators|configuration)\w)+\b')); > > Thanks to: > > http://www.roscripts.com/PHP_regular_expressions_examples-136.html > > On May 14, 3:38 pm, Aaron Shafovaloff <[EMAIL PROTECTED]> wrote: > > > With Router::connect I'd like to use a regular expression that would > > say "the curriculum cannot be > > xyz' ". Shouldn't this work? > > > Router::connect('/:group/:curriculum/*', > > array('controller'=>'curriculum'),array('curriculum'=>'!xyz')); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Regular expression in Router::connect
Wooo hoo! I figured it out: Router::connect('/:group/:curriculum/*', array('controller'=>'curriculum'),array('curriculum'=>'\b(?:(?! curriculum|courses|facilitators|configuration)\w)+\b')); Thanks to: http://www.roscripts.com/PHP_regular_expressions_examples-136.html On May 14, 3:38 pm, Aaron Shafovaloff <[EMAIL PROTECTED]> wrote: > With Router::connect I'd like to use a regular expression that would > say "the curriculum cannot be > xyz' ". Shouldn't this work? > > Router::connect('/:group/:curriculum/*', > array('controller'=>'curriculum'),array('curriculum'=>'!xyz')); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Regular expression in Router::connect
By the way, I need it to exclude multiple strings. So something to the effect of: Router::connect('/:group/:curriculum/*', array('controller'=>'curriculum'),array('curriculum'=>'!xyz AND !abc AND !mno')); On May 14, 3:38 pm, Aaron Shafovaloff <[EMAIL PROTECTED]> wrote: > With Router::connect I'd like to use a regular expression that would > say "the curriculum cannot be > xyz' ". Shouldn't this work? > > Router::connect('/:group/:curriculum/*', > array('controller'=>'curriculum'),array('curriculum'=>'!xyz')); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Regular expression in Router::connect
With Router::connect I'd like to use a regular expression that would say "the curriculum cannot be xyz' ". Shouldn't this work? Router::connect('/:group/:curriculum/*', array('controller'=>'curriculum'),array('curriculum'=>'!xyz')); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---