开发者

CakePHP Router::connect and regex

I'm having some trouble with redirection in config/routes.php file

I can't find the right regex

$_skill = '[A-Za-z\-]+'

Router::connect('/-:skill/:city-:zipcode:shit', array('controller' => 'redirects', 'action' => 'district'),
                    array('city' => '[A-Za-z-0-9\]+.(er|eme)-arrondissement',
                          'skill' => $_skill,
                          'zipcode' => $_zipcode,
                          'shit' => '开发者_Go百科(.*)',
                          'pass' => array('zipcode'),
                          )
                    );

I would like to match any url where city ends with 'arrondissement' but i'm a total noob in regex

thank you.


With most regex you can use the dollar symbol to match the end of a string.

simply 'arrondissement$'

And drop all the stuff at the beginning.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜