# pattern

[JS](/web/js.md) ⟩ [value](/web/js/val.md) ⟩ [object](/web/js/val/obj.md) ⟩ [regex](/web/js/val/builtin/regex.md) ⟩ pattern

{% hint style="success" %}
:point\_right: [regular expression cheatsheet](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Cheatsheet)
{% endhint %}

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

* [special characters](/web/js/val/builtin/regex/pattern/special-characters.md)
* [anchor](/web/js/val/builtin/regex/pattern/anchor.md) - match position between characters.
* [repeat](/web/js/val/builtin/regex/pattern/repeat.md)
  * [greedy vs. lazy](/web/js/val/builtin/regex/pattern/repeat/greedy-vs.-lazy.md)
* [character set](/web/js/val/builtin/regex/pattern/char-set.md)
* [alternation (or)](/web/js/val/builtin/regex/pattern/or.md)
* [group](/web/js/val/builtin/regex/pattern/group.md)
  * [capturing group](/web/js/val/builtin/regex/pattern/group/capturing-group.md)
  * [named group](/web/js/val/builtin/regex/pattern/group/capturing-group/named-group.md)
    * [matchAll() using named groups](/web/js/val/prim/str/method/str.matchall/matchall-using-named-groups.md)
* [lookaround](/web/js/val/builtin/regex/pattern/lookaround.md)
* [inline modifier](/web/js/val/builtin/regex/pattern/inline-modifier.md)
* [replace pattern](/web/js/val/builtin/regex/pattern/replace-pattern.md)
  {% endtab %}

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

{% endtab %}

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

* [ ] [Regular Expression Quick Reference](http://regexrenamer.sourceforge.net/help/regex_quickref.html)
  {% endtab %}
  {% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lochiwei.gitbook.io/web/js/val/builtin/regex/pattern.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
