Builds a path segment pattern based on a route segment constraint.
All repetition quantifiers (*, +) expand to a linear, non-ambiguous form (segment(?:/segment)*) so the resulting regex cannot backtrack catastrophically.
*
+
segment(?:/segment)*
Optional
Partial route segment constraint for path matching.
The capture-group name to assign to the parameter (if any).
A string representing the path pattern.
Builds a path segment pattern based on a route segment constraint.
All repetition quantifiers (
*,+) expand to a linear, non-ambiguous form (segment(?:/segment)*) so the resulting regex cannot backtrack catastrophically.