Skip to content

Commit

Permalink
sisidovski review
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyroman committed Aug 29, 2024
1 parent fa40e21 commit 54ab810
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ It can be constructed using a string for each component, or from a shorthand str

This is a more complicated pattern which includes:
* [=part/modifier/optional=] parts marked with `?` (braces are needed to make it unambiguous exactly what is optional), and
* a [=part/type/regexp=] part named "`id`" which uses a regular expression to define what sorts of substrings match (the parentheses are required to mark it as a regular expression, and are not part of the regexp itself)
* a [=part/type/regexp=] part named "`id`" which uses a regular expression to define what sorts of substrings match (the parentheses are required to mark it as a regular expression, and are not part of the regexp itself).
</div>

<div class="example" id="example-intro-3">
Expand Down Expand Up @@ -958,7 +958,7 @@ It can be [=parse a pattern string|parsed=] to produce a [=/part list=] which de
<div class="example" id="example-pattern-strings">
Pattern strings can contain capture groups, which by default match the shortest possible string, up to a component-specific separator (`/` in the pathname, `.` in the hostname). For example, the pathname pattern "`/blog/:title`" will match "`/blog/hello-world`" but not "`/blog/2012/02`".

A regular expression can also be used instead, so the pathname pattern "`/blog/:year(\\d+)/:month(\\d+)`" will match "`/blog/2012/02`".
A regular expression enclosed in parentheses can also be used instead, so the pathname pattern "`/blog/:year(\\d+)/:month(\\d+)`" will match "`/blog/2012/02`".

A group can also be made <span class="allow-2119">optional</span>, or repeated, by using a modifier. For example, the pathname pattern "`/products/:id?"` will match both "`/products`" and "`/products/2`" (but not "`/products/`"). In the pathname specifically, groups automatically require a leading `/`; to avoid this, the group can be explicitly deliminated, as in the pathname pattern "`/products/{:id}?`".

Expand Down

0 comments on commit 54ab810

Please sign in to comment.