You could make it lazy: .*?
, that should match nothing every time.
Also, you don't have to have so many capture groups. You even have a numbered capture group within a named capture group. This is how I would write the expression:
^/?(?P<controller>.*?|home)/(?P<action>.*?|test)/?$
This retains the two named capture groups, but gets rid of the nested numbered capture group and also the non-capturing group which was not necessary.