# group

[JS](https://lochiwei.gitbook.io/web/js) ⟩ [value](https://lochiwei.gitbook.io/web/js/val) ⟩ [object](https://lochiwei.gitbook.io/web/js/val/obj) ⟩ [regex](https://lochiwei.gitbook.io/web/js/val/builtin/regex) ⟩ [pattern](https://lochiwei.gitbook.io/web/js/val/builtin/regex/pattern) ⟩ group

{% hint style="success" %}

```javascript
(...)	        // unnamed capturing group
(?<name>...)	// named capturing group
(?:...)	        // non-capturing group
(...|...|...)	// alternation

\N	        // match the text in unnamed capture #N.
\<name>	        // match the text in named capture “name”.

//                      ╭─#1──╮   ╭╮ <--- same as capture #1
const regex = /(?:\d{2})(\d{3})\d+\1/;
//             ╰───────╯ non-capturing group
//   ╭1╮    ╭1╮
   001234004123567
// ╰───match───╯
// ╰╯ non-capturing group
```

{% endhint %}

{% tabs %}
{% tab title="🔴 主題" %}

* [capturing-group](https://lochiwei.gitbook.io/web/js/val/builtin/regex/pattern/group/capturing-group "mention")
  * [named-group](https://lochiwei.gitbook.io/web/js/val/builtin/regex/pattern/group/capturing-group/named-group "mention")
    {% endtab %}

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

* [parse-.ini-file](https://lochiwei.gitbook.io/web/js/val/builtin/regex/ex/parse-.ini-file "mention") - named group
* [quick-brown-fox](https://lochiwei.gitbook.io/web/js/val/builtin/regex/ex/quick-brown-fox "mention") - named group
  {% endtab %}

{% tab title="📗 參考" %}

* [ ] JS.info ⟩ [Capturing groups](https://javascript.info/regexp-groups)
* [ ] [Regular Expression Quick Reference](http://regexrenamer.sourceforge.net/help/regex_quickref.html)
  {% endtab %}
  {% endtabs %}
