3 types derived from RegexRouteConstraint
Microsoft.AspNetCore.Routing (2)
Constraints\AlphaRouteConstraint.cs (1)
15public partial class AlphaRouteConstraint : RegexRouteConstraint, ICachableParameterPolicy
Constraints\RegexInlineRouteConstraint.cs (1)
16public class RegexInlineRouteConstraint : RegexRouteConstraint, ICachableParameterPolicy
Microsoft.AspNetCore.Routing.Tests (1)
DefaultParameterPolicyFactoryTest.cs (1)
567public class RegexInlineRouteConstraintWithService : RegexRouteConstraint
24 instantiations of RegexRouteConstraint
Microsoft.AspNetCore.Routing (2)
Patterns\RoutePatternFactory.cs (1)
955return ParameterPolicyCore(new RegexRouteConstraint("^(" + content + ")$"));
RouteConstraintBuilder.cs (1)
115constraint = new RegexRouteConstraint(constraintsRegEx);
Microsoft.AspNetCore.Routing.Tests (20)
Constraints\RegexRouteConstraintTests.cs (5)
30var constraint = new RegexRouteConstraint(constraintValue); 49var constraint = new RegexRouteConstraint(new Regex("^abc$")); 68var constraint = new RegexRouteConstraint(new Regex("^abc$")); 87var constraint = new RegexRouteConstraint(new Regex("^abc$")); 115var constraint = new RegexRouteConstraint("^([a-z]+)$");
DefaultLinkGeneratorProcessTemplateTest.cs (3)
675policies: new { p2 = new RegexRouteConstraint("\\d{4}"), }); 701policies: new { p2 = new RegexRouteConstraint("\\d{4}") }); 725policies: new { p2 = new RegexRouteConstraint("\\d{4}") });
Patterns\DefaultRoutePatternTransformerTest.cs (2)
216var policies = new { controller = "Home", action = new RegexRouteConstraint("Index"), }; 238var policies = new { controller = "Home", action = new RegexRouteConstraint("Index"), };
Patterns\RoutePatternFactoryTest.cs (10)
142var constraints = new { a = new RegexRouteConstraint("foo"), b = new RegexRouteConstraint("bar") }; 187var constraints = new { d = new RegexRouteConstraint("foo"), e = new RegexRouteConstraint("bar") }; 223var constraints = new { d = new object[] { new RegexRouteConstraint("foo"), new RegexRouteConstraint("bar"), "baz" } }; 254var constraints = new { b = "fizz", c = new object[] { new RegexRouteConstraint("foo"), new RegexRouteConstraint("bar"), "baz" } }; 800var policies = new { X = new RegexRouteConstraint("x"), }; 840var right = RoutePatternFactory.Parse("/b", defaults: null, parameterPolicies: new { X = new RegexRouteConstraint("foo") });
RoutingSandbox (1)
UseRouterStartup.cs (1)
34constraints: new { lastName = new RegexRouteConstraint(new Regex("[a-zA-Z]{3}", RegexOptions.CultureInvariant, RegexMatchTimeout)) });
RoutingWebSite (1)
UseRouterStartup.cs (1)
34constraints: new { lastName = new RegexRouteConstraint(new Regex("[a-zA-Z]{3}", RegexOptions.CultureInvariant, RegexMatchTimeout)) });
28 references to RegexRouteConstraint
Microsoft.AspNetCore.OpenApi (1)
Extensions\JsonNodeSchemaExtensions.cs (1)
237else if (constraint is RegexRouteConstraint regexRouteConstraint)
Microsoft.AspNetCore.Routing (4)
Constraints\RegexRouteConstraint.cs (2)
31/// Constructor for a <see cref="RegexRouteConstraint"/> given a <paramref name="regex"/>. 42/// Constructor for a <see cref="RegexRouteConstraint"/> given a <paramref name="regexPattern"/>.
Patterns\RoutePatternFactory.cs (1)
943/// then it will be transformed into an instance of <see cref="RegexRouteConstraint"/>.
RouteConstraintBuilder.cs (1)
90/// If the <paramref name="value"/> is a string, it will be converted to a <see cref="RegexRouteConstraint"/>.
Microsoft.AspNetCore.Routing.Tests (23)
Constraints\RegexRouteConstraintTests.cs (5)
30var constraint = new RegexRouteConstraint(constraintValue); 49var constraint = new RegexRouteConstraint(new Regex("^abc$")); 68var constraint = new RegexRouteConstraint(new Regex("^abc$")); 87var constraint = new RegexRouteConstraint(new Regex("^abc$")); 115var constraint = new RegexRouteConstraint("^([a-z]+)$");
Patterns\RoutePatternFactoryTest.cs (15)
156c => Assert.IsType<RegexRouteConstraint>(c.ParameterPolicy), 160c => Assert.IsType<RegexRouteConstraint>(c.ParameterPolicy)); 169c => Assert.IsType<RegexRouteConstraint>(c.ParameterPolicy), 177c => Assert.IsType<RegexRouteConstraint>(c.ParameterPolicy)); 206c => Assert.IsType<RegexRouteConstraint>(c.ParameterPolicy)); 213c => Assert.IsType<RegexRouteConstraint>(c.ParameterPolicy)); 242c => Assert.Equal("foo", Assert.IsType<RegexRouteConstraint>(c.ParameterPolicy).Constraint.ToString()), 243c => Assert.Equal("bar", Assert.IsType<RegexRouteConstraint>(c.ParameterPolicy).Constraint.ToString()), 244c => Assert.Equal("^(baz)$", Assert.IsType<RegexRouteConstraint>(c.ParameterPolicy).Constraint.ToString())); 280c => Assert.Equal("^(fizz)$", Assert.IsType<RegexRouteConstraint>(c.ParameterPolicy).Constraint.ToString())); 287c => Assert.Equal("foo", Assert.IsType<RegexRouteConstraint>(c.ParameterPolicy).Constraint.ToString()), 288c => Assert.Equal("bar", Assert.IsType<RegexRouteConstraint>(c.ParameterPolicy).Constraint.ToString()), 289c => Assert.Equal("^(baz)$", Assert.IsType<RegexRouteConstraint>(c.ParameterPolicy).Constraint.ToString()), 374var regex = Assert.IsType<RegexRouteConstraint>(Assert.Single(kvp.Value).ParameterPolicy);
RouteConstraintBuilderTest.cs (1)
29Assert.IsType<RegexRouteConstraint>(Assert.Single(result).Value);
RouteTest.cs (2)
1643Assert.IsType<RegexRouteConstraint>(constraints["controller"]); 1664Assert.IsType<RegexRouteConstraint>(constraint.Constraints.ElementAt(0));