---
description: 🚧 under construction
---

# special characters

[JS](../../../..) ⟩ [value](../../..) ⟩ [object](../../../obj) ⟩ [regex](..) ⟩ [pattern]() ⟩ 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: [char-set](char-set "mention").
* <mark style="color:yellow;">**`?`**</mark> - [**repeat**](repeat) <mark style="color:yellow;">**0 \~ 1**</mark>, or <mark style="color:orange;">**lazy**</mark>.
* <mark style="color:yellow;">**`+`**</mark> - [**repeat**](repeat) <mark style="color:yellow;">**1 \~ ∞**</mark>.
* <mark style="color:yellow;">**`*`**</mark> - [**repeat**](repeat) <mark style="color:yellow;">**0 \~ ∞**</mark>.
* <mark style="color:yellow;">**`^`**</mark> - [**beginning anchor**](anchor), or <mark style="color:yellow;">**invert**</mark> a set :point\_right: [char-set](char-set "mention").
* <mark style="color:yellow;">**`$`**</mark> - [**end anchor**](anchor).
* <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**](group).
* <mark style="color:yellow;">**`[]`**</mark> - ranges, alternation, :point\_right: [char-set](char-set "mention").
* <mark style="color:yellow;">**`{}`**</mark> - times to [**repeat**](repeat).
* <mark style="color:yellow;">**`|`**</mark> - [**alternation (or)**](or).
{% 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 %}
