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 => {