Is it possible to have optional route segments/variables with getCpRoutes() and getSiteRoutes()?
I'd like the following route to work, even if the URI only contains one segment ("myplugin") rather than two ("myplugin/somevalue"):
"myplugin/(?P<myVariable>[-\w]+)" => array( "action" => "myPlugin/myAction" )
How would the regexp look? Is it even possible, or do I need another route pointing to the same action, but omitting the myVariable segment?
This question is kind of a follow up to Route that should be matching numbers not matching a zero?