URL MAnager rule

is it possible to create a rule to parse a string separated by dashes and discard everything after the first block

domain.com/controller/action/55-rest-of-string

something like?




'<controller:\w+>/<action:\w+>/<id:\d+>(?<img src='http://www.yiiframework.com/forum/public/style_emoticons/default/embarrassed.gif' class='bbc_emoticon' alt=':-[' />-\w]+)'=>'<controller>/<action>'


something like this works

'<controller:\w+>/<action:\w+>/<id:\d+><slug:(?<img src='http://www.yiiframework.com/forum/public/style_emoticons/default/embarrassed.gif' class='bbc_emoticon' alt=':-[' />-\w]+)?>'=>'<controller>/<action>'



just trying to see if can do that using 1 GET param :)

I am not certain you could avoid using a 2nd GET param.

I would advise to keep it anyway, it will be easier to create an url in views using the rule




echo CHtml::link('Rest of string', $this->createUrl('controller/action',array('id'=>55, 'slug'=>'rest-of-string')));