> 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/special-characters.md).

# special characters

🚧 under construction

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

{% hint style="success" %}

```javascript
// need to be escaped with a backslash (\)
. ? + * ^ $ \ /
( ) [ ] { } |	
// any other character matches itself.
```

{% endhint %}

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

* <mark style="color:yellow;">**`.`**</mark> - any character :point\_right: [character set](/web/js/val/builtin/regex/pattern/char-set.md).
* <mark style="color:yellow;">**`?`**</mark> - [**repeat**](/web/js/val/builtin/regex/pattern/repeat.md) <mark style="color:yellow;">**0 \~ 1**</mark>, or <mark style="color:orange;">**lazy**</mark>.
* <mark style="color:yellow;">**`+`**</mark> - [**repeat**](/web/js/val/builtin/regex/pattern/repeat.md) <mark style="color:yellow;">**1 \~ ∞**</mark>.
* <mark style="color:yellow;">**`*`**</mark> - [**repeat**](/web/js/val/builtin/regex/pattern/repeat.md) <mark style="color:yellow;">**0 \~ ∞**</mark>.
* <mark style="color:yellow;">**`^`**</mark> - [**beginning anchor**](/web/js/val/builtin/regex/pattern/anchor.md), or <mark style="color:yellow;">**invert**</mark> a set :point\_right: [character set](/web/js/val/builtin/regex/pattern/char-set.md).
* <mark style="color:yellow;">**`$`**</mark> - [**end anchor**](/web/js/val/builtin/regex/pattern/anchor.md).
* <mark style="color:yellow;">**`\`**</mark> - escape.
* <mark style="color:yellow;">**`/`**</mark> - delimiter for regex in JS, for example: <mark style="color:blue;">`/abc/`</mark>.
* <mark style="color:yellow;">**`()`**</mark> - [**group**](/web/js/val/builtin/regex/pattern/group.md).
* <mark style="color:yellow;">**`[]`**</mark> - ranges, alternation, :point\_right: [character set](/web/js/val/builtin/regex/pattern/char-set.md).
* <mark style="color:yellow;">**`{}`**</mark> - times to [**repeat**](/web/js/val/builtin/regex/pattern/repeat.md).
* <mark style="color:yellow;">**`|`**</mark> - [**alternation (or)**](/web/js/val/builtin/regex/pattern/or.md).
  {% endtab %}

{% tab title="⭐️ 重點" %}
{% hint style="warning" %}

```javascript
[.+]	// ".", "+" have NO special meaning in brackets
```

{% endhint %}
{% endtab %}

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

```javascript
// code
```

{% endtab %}

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

* [ ] [Regular Expression Quick Reference](http://regexrenamer.sourceforge.net/help/regex_quickref.html)
* [ ] Eloquent JavaScript ⟩ Regular Expressions ⟩ [Sets of Characters](https://eloquentjavascript.net/09_regexp.html#h_8EFR0DU1xd)
  {% endtab %}

{% tab title="📘 手冊" %}

* [ ] [JavaScript Guide](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide) ⟩ [Regular expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) ⟩&#x20;
  * [ ] [escaping](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping)&#x20;
  * [ ] [Unicode property escapes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Cheatsheet#unicode_property_escapes)
    {% endtab %}
    {% endtabs %}
