I'm trying to create an ASP.NET MVC2 route with a regular expression constraint to filter language names (like en-us, pt-br) but unfortunately it doesn't work. Have a look:
routes.MapRoute(
"Culture", // Route name
"{culture}", // URL with parameters
new { controller = "Home", action = "Culture" }, // Parameter defaults
new { culture = @"^[a-z]{2}-[a-z]{2}$" }
);
Does anyone have any idea?
Edit: The url i'm testing is http://localhost/en-us