Using regexp for this kind of logic looks not good way.
I think it's better to use `#controller_name` & `#action_name` than regexp with request.path_info.

Even if you would use regexp and request.path_info, this kind of complex logic should be written in ApplicationHelper.