Codeigniter复杂通配符路由

Hi guys I am trying to achieve something that I hope is possible but couldn't find the right way to find. I am using codeigniter 2.2.0 I want to use an url in codeigniter like

domain/username/controller/method/$args

Let me explain When user types an url like

domain/mike/job/editJob/12/urgent/

Here "mike" is someone's user name 
"job" will be a controller alias 
"editJob" will be a method 
"12" and "urgent" will be parameter of editJob method. 
editJob method will have three parameters. 
I want "mike" as 1st parameter, 
then "12" and "urgent" as second and third parameter.

So far what I have done in my routes

$route['(:any)/job/(:any)'] = 'job_c/$2/$1';

When I type in the url

domain/mike/job/editJob/12/urgent

in Job controller I get

"12" as first parameter
"urgent" as second parameter
and "mike" as third parameter

** Is there any possible way to get "mike" as first parameter and then the rest is okay**

Edited: One more thing if I pass three parameters after method then I am not getting the username!!

I need to have the username as first parameter because there may have multiple parameters in any method and there is a possibility to have conditional parameters as well.

One more thing I want to know. Is it possible to make such route that will work the same as my given route but the controller alias will also be wildcard. Or if there is any way to check if a segment in url is a controller then one route and if not a controller then something else should happen.

I am not a well describer still tried to keep it simple. If anyone knows something that will help me a lot.

Thanks

UPDATE Is there any way to keep the username "mike" in session from routes.php file thus I don't have to pass this as a parameter.

Updating Again I have solved the issue somehow. I am using

$route['(:any)/garage/([^/]*)/([^/]*)/(.*)'] = '$2/$3/$1/$4';

Here garage is nothing but a simple identifier for the route. This route will work when it gets garage as a second segment in url. It will work like

domain/user/garage/anyControler/anyMethod/manyParameters

It's completely dynamic only the garage is used as identifier. If you want you can use your controller name instead of using any identifier. then you don't have to declare same thing multiple times for multiple controllers but it will work fine. It will work for any controller and any method. In addition it supports dynamic number of parameters. I don't know if there is any better way to do this but it solves my issue. If anyone know something better then this then please share.

I think what is happening is that you are accessing

domain/mike/job/editJob/12/urgent

and its being parsed like: job_c/editJob/12/urgent/mike

Because:

$route['(:any)/job/(:any)'] = 'job_c/$2/$1';

$2 = (:any)/job/(:any) = editJob/12/urgent
$1 = (:any)/job/(:any) = mike

Substituting: job_c/editJob/12/urgent/mike

You could try to keep your route as similar as your current one:

 $route['(:any)/job/(:any)/(:any)'] = 'job_c/$2/$1/$3';

This will allow you to match $2 to any method name, and have $1 as the first parameter and $3 as the rest of params.

But, I would suggest, if this is a very specific route, substituting the $2 :any, with the actual method name and the expected type of the params, otherwise, you might receive unexpected values to every method in the matching controller. I would use something like:

 $route['(:any)/job/editJob/(:num)/(:any)'] = 'job_c/editJob/$1/$2/$3';

Hope this helps.

Update: For the controller matching: Code Igniter uses the form controller/method/param1/param2/...

As long as you create routes that matches controllers, methods and params in that order, you can do anything.

$route['(:any)/(:any)/(:any)'] = '$1/$2/$3';

or just

$route['(:any)'] = '$1';

and hopefully it will contain a controller and method and the required params.

I think this will totally be missing the point of having a routing system.