I have used two regular expressions, one to limit the first parameter(year) to 4 digits and the second(month) to limit the second parameter to 2 digits.
[Route("movies/released/{year:regex(\\d{4})}/{month:regex(\\d{2}):range(1, 12)}")] public ActionResult ByReleaseDate(int year, int month) { return Content($"{year}/{month}"); } This partially works, when I navigate to /movies/released/2017/13 I am shown a 404.
But when I navigate to /movies/released/200017/03 a 404 is not produced.