Add Hypen to seo url

Hello All,

Please help me to add hyphen to url.

Here is my pre configured url manager:


'urlManager' => array(

	'brands/<name:\w+>' => 'brands/view',



By configuring I’m able to visit url:

But not:

Please help me to add hyphen to use above url


[font="Courier New"]\w[/font] means an alphanumeric character, and [font="Courier New"]\w+[/font] means one or more of them. But a hyphen is not an alphanumeric character. So my approach is:

'brands/<name:.+>' => 'brands/view',

this even works for name with space ‘brands/something like this’

'brands/<name:.+>' => 'brands/view',

if you want limit to alphanumeric plus ‘-’ or ‘_’, you can do this

'brands/<name:[a-z|0-9|\-|\_]+>' => 'brands/view',

Thanks Root Bear,

This I was looking

'brands/<name:[a-zA-Z\-]>' => 'brands/view',

Will this work naa?