|
7 | 7 | let regex = $state('(?<name>[a-zA-Z0-9._%+-]+)@(?<domain>[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})') |
8 | 8 | let string = $state('[email protected]') |
9 | 9 |
|
10 | | - let case_insensitive_flag = $state(false) |
11 | | - let dotall_flag = $state(false) |
12 | | - let multiline_flag = $state(false) |
13 | | - let disable_unicode_groups_flag = $state(false) |
14 | | - let longest_match_flag = $state(false) |
| 10 | + let caseInsensitiveFlag = $state(false) |
| 11 | + let dotallFlag = $state(false) |
| 12 | + let multilineFlag = $state(false) |
| 13 | + let disableUnicodeGroupsflag = $state(false) |
| 14 | + let longestMatchFlag = $state(false) |
15 | 15 |
|
16 | 16 | let results = $state({}) |
17 | 17 |
|
|
49 | 49 |
|
50 | 50 | $effect(() => { |
51 | 51 | let flags = 0 |
52 | | - if (case_insensitive_flag) { |
| 52 | + if (caseInsensitiveFlag) { |
53 | 53 | flags = flags | CASE_INSENSITIVE |
54 | 54 | } |
55 | | - if (dotall_flag) { |
| 55 | + if (dotallFlag) { |
56 | 56 | flags = flags | DOTALL |
57 | 57 | } |
58 | | - if (multiline_flag) { |
| 58 | + if (multilineFlag) { |
59 | 59 | flags = flags | MULTILINE |
60 | 60 | } |
61 | | - if (disable_unicode_groups_flag) { |
| 61 | + if (disableUnicodeGroupsflag) { |
62 | 62 | flags = flags | DISABLE_UNICODE_GROUPS |
63 | 63 | } |
64 | | - if (longest_match_flag) { |
| 64 | + if (longestMatchFlag) { |
65 | 65 | flags = flags | LONGEST_MATCH |
66 | 66 | } |
67 | 67 | // debounce result |
|
110 | 110 | <div> |
111 | 111 | <fieldset> |
112 | 112 | <legend>Regular expression flags</legend> |
113 | | - <label for="case_insensitive_flag"> |
| 113 | + <label for="caseInsensitiveFlag"> |
114 | 114 | <input |
115 | 115 | type="checkbox" |
116 | | - id="case_insensitive_flag" |
117 | | - name="case_insensitive_flag" |
118 | | - bind:checked={case_insensitive_flag} |
| 116 | + id="caseInsensitiveFlag" |
| 117 | + name="caseInsensitiveFlag" |
| 118 | + bind:checked={caseInsensitiveFlag} |
119 | 119 | /> |
120 | 120 | Case insensitive matching |
121 | 121 | </label> |
122 | | - <label for="dotall_flag"> |
123 | | - <input type="checkbox" id="dotall_flag" name="dotall_flag" bind:checked={dotall_flag} /> |
| 122 | + <label for="dotallFlag"> |
| 123 | + <input type="checkbox" id="dotallFlag" name="dotallFlag" bind:checked={dotallFlag} /> |
124 | 124 | "." matches all characters |
125 | 125 | </label> |
126 | | - <label for="multiline_flag"> |
| 126 | + <label for="multilineFlag"> |
127 | 127 | <input |
128 | 128 | type="checkbox" |
129 | | - id="multiline_flag" |
130 | | - name="multiline_flag" |
131 | | - bind:checked={multiline_flag} |
| 129 | + id="multilineFlag" |
| 130 | + name="multilineFlag" |
| 131 | + bind:checked={multilineFlag} |
132 | 132 | /> |
133 | 133 | Multiline matching |
134 | 134 | </label> |
135 | | - <label for="disable_unicode_groups_flag"> |
| 135 | + <label for="disableUnicodeGroupsflag"> |
136 | 136 | <input |
137 | 137 | type="checkbox" |
138 | | - id="disable_unicode_groups_flag" |
139 | | - name="disable_unicode_groups_flag" |
140 | | - bind:checked={disable_unicode_groups_flag} |
| 138 | + id="disableUnicodeGroupsflag" |
| 139 | + name="disableUnicodeGroupsflag" |
| 140 | + bind:checked={disableUnicodeGroupsflag} |
141 | 141 | /> |
142 | 142 | Disable unicode groups |
143 | 143 | </label> |
144 | | - <label for="longest_match_flag"> |
| 144 | + <label for="longestMatchFlag"> |
145 | 145 | <input |
146 | 146 | type="checkbox" |
147 | | - id="longest_match_flag" |
148 | | - name="longest_match_flag" |
149 | | - bind:checked={longest_match_flag} |
| 147 | + id="longestMatchFlag" |
| 148 | + name="longestMatchFlag" |
| 149 | + bind:checked={longestMatchFlag} |
150 | 150 | /> |
151 | 151 | Matches longest possible string |
152 | 152 | </label> |
|
0 commit comments