> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/web/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/web/js/val/builtin/regex/pattern/group/capturing-group/named-group.md).

# named group

[JS](/web/js.md) ⟩ [objects](/web/js/val/obj.md) ⟩ [built-in](/web/js/val/builtin.md) ⟩ [regex](/web/js/val/builtin/regex.md) ⟩ [capturing group](/web/js/val/builtin/regex/pattern/group/capturing-group/named-group.md) ⟩ named group

{% hint style="success" %}

```javascript
// ⭐️ date pattern: yyyy-mm-dd
//          ╭--- year ---╮ ╭--- month ---╮ ╭--- day ---╮ (⭐️ named groups)              
let date = /(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/g;
```

{% endhint %}

{% tabs %}
{% tab title="💈範例" %}

* [str.matchAll()](/web/js/val/prim/str/method/str.matchall.md) ⟩ [matchAll() using named groups](/web/js/val/prim/str/method/str.matchall/matchall-using-named-groups.md)
  {% endtab %}
  {% endtabs %}
