Bugfix/routing regex (#1738)

* Fix the regex route in Startup.cs

* Fix the regex route in routing.rst
pull/1745/head
Artiom Chilaru 2016-08-01 21:02:31 +01:00 committed by Rick Anderson
parent ee98cbf083
commit 36fc584925
2 changed files with 2 additions and 2 deletions

View File

@ -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``

View File

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