@@ -53,20 +53,20 @@ assert.deepStrictEqual(results, [
53
53
## RegExp-like String
54
54
55
55
This library aim to represent RegExp in JSON and use it for ignoring words.
56
- ` g ` (global) flag is added by default, Because ignoring words is always global in a document .
57
-
58
-
59
- | Input | Ouput | Note |
60
- | ---- | --- | --- |
61
- | ` "str" ` | ` /str/g ` | convert string to regexp with global |
62
- | ` "/str/" ` | ` /str/g ` | |
63
- | ` "/str/g " ` | ` /str/g ` | Duplicated ` g ` is just ignored |
64
- | ` "/str/i " ` | ` /str/ig ` | |
65
- | ` "/str/u " ` | ` /str/ug ` | |
66
- | ` "/str/m " ` | ` /str/mg ` | |
67
- | ` "/str/y" ` | ` /str/yg ` | |
68
- | --- | --- | --- |
69
- | ` "/\\d+/" ` | ` /\d+/g ` | You should escape meta character like ` \d ` |
56
+ ` g ` (global) flag and ` u ` (unicode) is added by default.
57
+
58
+ | Input | Ouput | Note |
59
+ | -------------- | --------- | -------------------------------------------- |
60
+ | ` "str" ` | ` /str/gu ` | convert string to regexp with global |
61
+ | ` "/ str/ " ` | ` /str/gu ` | |
62
+ | ` "/str/g " ` | ` /str/gu ` | Duplicated ` g ` is just ignored |
63
+ | ` "/str/i " ` | ` /str/igu ` | |
64
+ | ` "/str/u " ` | ` /str/ug ` | |
65
+ | ` "/str/m " ` | ` /str/mgu ` | |
66
+ | ` "/str/y " ` | ` /str/ygu ` | |
67
+ | --- | --- | --- |
68
+ | ` "/\\d+/" ` | ` /\d+/gu ` | You should escape meta character like ` \d ` |
69
+ | ` "/( \\d+) /" ` | ` /\d+/gu ` | You can use capture |
70
70
71
71
:warning : You should escape meta character like ` \d ` in RegExp-like string.
72
72
0 commit comments