Commit cc3bb9f
Fix handling of case-sensitive set loops in RegexPrefixAnalyzer.FindPrefixes (dotnet#101608)
* Fix handling of case-sensitive set loops in RegexPrefixAnalyzer.FindPrefixes
For an expression like `[Aa]{2}`, we were generating the strings "AA" and "aa" but not "Aa" or "aA".
This code isn't exercised yet, as we're currently only using FindPrefixes for case-insensitive, but I'm trying to enable it for case-sensitive as well, and hit this. I'm not adding new tests here as plenty of existing tests catch it once it's enabled.
* Also exit early as soon as we can detect too many possible prefixes1 parent 70efef9 commit cc3bb9f
File tree
2 files changed
+35
-19
lines changed- src/libraries/System.Text.RegularExpressions
- src/System/Text/RegularExpressions
- tests/FunctionalTests
2 files changed
+35
-19
lines changedLines changed: 29 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | | - | |
| 65 | + | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
162 | 164 | | |
163 | 165 | | |
164 | 166 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
| 167 | + | |
169 | 168 | | |
170 | | - | |
| 169 | + | |
| 170 | + | |
171 | 171 | | |
172 | | - | |
173 | | - | |
174 | | - | |
| 172 | + | |
175 | 173 | | |
176 | | - | |
177 | 174 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
182 | 191 | | |
183 | 192 | | |
184 | 193 | | |
| |||
248 | 257 | | |
249 | 258 | | |
250 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
251 | 266 | | |
252 | 267 | | |
253 | 268 | | |
| |||
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1172 | 1172 | | |
1173 | 1173 | | |
1174 | 1174 | | |
| 1175 | + | |
1175 | 1176 | | |
1176 | 1177 | | |
1177 | 1178 | | |
| |||
1180 | 1181 | | |
1181 | 1182 | | |
1182 | 1183 | | |
1183 | | - | |
1184 | | - | |
1185 | | - | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
1186 | 1187 | | |
1187 | 1188 | | |
1188 | 1189 | | |
1189 | 1190 | | |
1190 | 1191 | | |
1191 | | - | |
| 1192 | + | |
1192 | 1193 | | |
1193 | 1194 | | |
1194 | 1195 | | |
1195 | 1196 | | |
1196 | 1197 | | |
1197 | 1198 | | |
1198 | 1199 | | |
1199 | | - | |
| 1200 | + | |
1200 | 1201 | | |
1201 | 1202 | | |
1202 | 1203 | | |
| |||
0 commit comments