Bugfix/routing regex (#1738)
* Fix the regex route in Startup.cs * Fix the regex route in routing.rstpull/1745/head
parent
ee98cbf083
commit
36fc584925
|
@ -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``
|
||||
|
|
|
@ -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 =>
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue