|
45 | 45 |
|
46 | 46 | const execRE2JSDebounce = debounce(execRE2JS, 300) |
47 | 47 |
|
48 | | - const { |
49 | | - CASE_INSENSITIVE, |
50 | | - DOTALL, |
51 | | - MULTILINE, |
52 | | - DISABLE_UNICODE_GROUPS, |
53 | | - LONGEST_MATCH |
54 | | - } = RE2JS |
| 48 | + const { CASE_INSENSITIVE, DOTALL, MULTILINE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH } = RE2JS |
55 | 49 |
|
56 | 50 | $effect(() => { |
57 | 51 | let flags = 0 |
|
76 | 70 |
|
77 | 71 | onMount(() => { |
78 | 72 | globalThis.RE2JS = RE2JS // expose RE2JS to global scope |
79 | | - console.log('%c Feel free to try RE2JS here 😎', `color: light-dark( |
| 73 | + console.log( |
| 74 | + '%c Feel free to try RE2JS here 😎', |
| 75 | + `color: light-dark( |
80 | 76 | oklch(50% 0.15 100), |
81 | 77 | oklch(90% 0.15 100) |
82 | | - )`) |
| 78 | + )` |
| 79 | + ) |
83 | 80 | }) |
84 | 81 | </script> |
85 | 82 |
|
|
96 | 93 | id="regex" |
97 | 94 | name="regex" |
98 | 95 | placeholder="Insert your regular expression here" |
99 | | - bind:value="{regex}" |
100 | | - aria-invalid="{results && !results.success}" |
| 96 | + bind:value={regex} |
| 97 | + aria-invalid={results && !results.success} |
101 | 98 | /> |
102 | 99 |
|
103 | 100 | <label for="string">Test string</label> |
|
106 | 103 | id="string" |
107 | 104 | name="string" |
108 | 105 | placeholder="Insert your test string here" |
109 | | - bind:value="{string}" |
| 106 | + bind:value={string} |
110 | 107 | ></textarea> |
111 | 108 | </div> |
112 | 109 |
|
|
118 | 115 | type="checkbox" |
119 | 116 | id="case_insensitive_flag" |
120 | 117 | name="case_insensitive_flag" |
121 | | - bind:checked="{case_insensitive_flag}" |
| 118 | + bind:checked={case_insensitive_flag} |
122 | 119 | /> |
123 | 120 | Case insensitive matching |
124 | 121 | </label> |
125 | 122 | <label for="dotall_flag"> |
126 | | - <input type="checkbox" id="dotall_flag" name="dotall_flag" bind:checked="{dotall_flag}" /> |
| 123 | + <input type="checkbox" id="dotall_flag" name="dotall_flag" bind:checked={dotall_flag} /> |
127 | 124 | "." matches all characters |
128 | 125 | </label> |
129 | 126 | <label for="multiline_flag"> |
130 | 127 | <input |
131 | 128 | type="checkbox" |
132 | 129 | id="multiline_flag" |
133 | 130 | name="multiline_flag" |
134 | | - bind:checked="{multiline_flag}" |
| 131 | + bind:checked={multiline_flag} |
135 | 132 | /> |
136 | 133 | Multiline matching |
137 | 134 | </label> |
|
140 | 137 | type="checkbox" |
141 | 138 | id="disable_unicode_groups_flag" |
142 | 139 | name="disable_unicode_groups_flag" |
143 | | - bind:checked="{disable_unicode_groups_flag}" |
| 140 | + bind:checked={disable_unicode_groups_flag} |
144 | 141 | /> |
145 | 142 | Disable unicode groups |
146 | 143 | </label> |
|
149 | 146 | type="checkbox" |
150 | 147 | id="longest_match_flag" |
151 | 148 | name="longest_match_flag" |
152 | | - bind:checked="{longest_match_flag}" |
| 149 | + bind:checked={longest_match_flag} |
153 | 150 | /> |
154 | 151 | Matches longest possible string |
155 | 152 | </label> |
|
181 | 178 | <td class="val-cell"> |
182 | 179 | <span |
183 | 180 | class="status-tag" |
184 | | - class:status-tag__yes="{results.matches}" |
185 | | - class:status-tag__no="{!results.matches}">{results.matches ? 'yes' : 'no'}</span |
| 181 | + class:status-tag__yes={results.matches} |
| 182 | + class:status-tag__no={!results.matches}>{results.matches ? 'yes' : 'no'}</span |
186 | 183 | > |
187 | 184 | </td> |
188 | 185 | </tr> |
|
191 | 188 | <td class="val-cell"> |
192 | 189 | <span |
193 | 190 | class="status-tag" |
194 | | - class:status-tag__yes="{results.contains}" |
195 | | - class:status-tag__no="{!results.contains}">{results.contains ? 'yes' : 'no'}</span |
| 191 | + class:status-tag__yes={results.contains} |
| 192 | + class:status-tag__no={!results.contains}>{results.contains ? 'yes' : 'no'}</span |
196 | 193 | > |
197 | 194 | </td> |
198 | 195 | </tr> |
|
201 | 198 | <td class="val-cell"> |
202 | 199 | <span |
203 | 200 | class="status-tag" |
204 | | - class:status-tag__yes="{results.startWith}" |
205 | | - class:status-tag__no="{!results.startWith}">{results.startWith ? 'yes' : 'no'}</span |
| 201 | + class:status-tag__yes={results.startWith} |
| 202 | + class:status-tag__no={!results.startWith}>{results.startWith ? 'yes' : 'no'}</span |
206 | 203 | > |
207 | 204 | </td> |
208 | 205 | </tr> |
|
0 commit comments