only convert route to regex when it is string