# named group

[JS](https://lochiwei.gitbook.io/web/js) ⟩ [objects](https://lochiwei.gitbook.io/web/js/val/obj) ⟩ [built-in](https://lochiwei.gitbook.io/web/js/val/builtin) ⟩ [regex](https://lochiwei.gitbook.io/web/js/val/builtin/regex) ⟩ [capturing group](https://lochiwei.gitbook.io/web/js/val/builtin/regex/pattern/group/capturing-group/named-group) ⟩ 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](https://lochiwei.gitbook.io/web/js/val/prim/str/method/str.matchall "mention") ⟩ [matchall-using-named-groups](https://lochiwei.gitbook.io/web/js/val/prim/str/method/str.matchall/matchall-using-named-groups "mention")
  {% endtab %}
  {% endtabs %}
