From 36fc58492591aefaf04871cb2b5d5f3ea3019152 Mon Sep 17 00:00:00 2001 From: Artiom Chilaru Date: Mon, 1 Aug 2016 21:02:31 +0100 Subject: [PATCH] Bugfix/routing regex (#1738) * Fix the regex route in Startup.cs * Fix the regex route in routing.rst --- aspnet/fundamentals/routing.rst | 2 +- aspnet/fundamentals/routing/sample/RoutingSample/Startup.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnet/fundamentals/routing.rst b/aspnet/fundamentals/routing.rst index a4615314e0..ab75dda709 100644 --- a/aspnet/fundamentals/routing.rst +++ b/aspnet/fundamentals/routing.rst @@ -353,7 +353,7 @@ The following table demonstrates some route constraints and their expected behav - Steve - String must consist of alphabetical characters. * - ``regex(expression)`` - - {ssn:regex(\d{3}-\d{2}-\d{4})} + - {ssn:regex(^\d{3}-\d{2}-\d{4}$)} - 123-45-6789 - String must match the provided regular expression. * - ``required`` diff --git a/aspnet/fundamentals/routing/sample/RoutingSample/Startup.cs b/aspnet/fundamentals/routing/sample/RoutingSample/Startup.cs index 823286a087..4b852721db 100644 --- a/aspnet/fundamentals/routing/sample/RoutingSample/Startup.cs +++ b/aspnet/fundamentals/routing/sample/RoutingSample/Startup.cs @@ -27,7 +27,7 @@ namespace RoutingSample routeBuilder.MapRoute( "Track Package Route", - "package/{operation:regex(track|create|detonate)}/{id:int}"); + "package/{operation:regex(^track|create|detonate$)}/{id:int}"); routeBuilder.MapGet("hello/{name}", context => {