Debian Codegraph @

.cargo/vendor/regex/CHANGELOG.md

raw
1 1.10.3 (2024-01-21)
2 ===================
3 This is a new patch release that fixes the feature configuration of optional
4 dependencies, and fixes an unsound use of bounds check elision.
5
6 Bug fixes:
7
8 * [BUG #1147](https://github.com/rust-lang/regex/issues/1147):
9 Set `default-features=false` for the `memchr` and `aho-corasick` dependencies.
10 * [BUG #1154](https://github.com/rust-lang/regex/pull/1154):
11 Fix unsound bounds check elision.
12
13
14 1.10.2 (2023-10-16)
15 ===================
16 This is a new patch release that fixes a search regression where incorrect
17 matches could be reported.
18
19 Bug fixes:
20
21 * [BUG #1110](https://github.com/rust-lang/regex/issues/1110):
22 Revert broadening of reverse suffix literal optimization introduced in 1.10.1.
23
24
25 1.10.1 (2023-10-14)
26 ===================
27 This is a new patch release with a minor increase in the number of valid
28 patterns and a broadening of some literal optimizations.
29
30 New features:
31
32 * [FEATURE 04f5d7be](https://github.com/rust-lang/regex/commit/04f5d7be4efc542864cc400f5d43fbea4eb9bab6):
33 Loosen ASCII-compatible rules such that regexes like `(?-u:☃)` are now allowed.
34
35 Performance improvements:
36
37 * [PERF 8a8d599f](https://github.com/rust-lang/regex/commit/8a8d599f9d2f2d78e9ad84e4084788c2d563afa5):
38 Broader the reverse suffix optimization to apply in more cases.
39
40
41 1.10.0 (2023-10-09)
42 ===================
43 This is a new minor release of `regex` that adds support for start and end
44 word boundary assertions. That is, `\<` and `\>`. The minimum supported Rust
45 version has also been raised to 1.65, which was released about one year ago.
46
47 The new word boundary assertions are:
48
49 * `\<` or `\b{start}`: a Unicode start-of-word boundary (`\W|\A` on the left,
50 `\w` on the right).
51 * `\>` or `\b{end}`: a Unicode end-of-word boundary (`\w` on the left, `\W|\z`
52 on the right)).
53 * `\b{start-half}`: half of a Unicode start-of-word boundary (`\W|\A` on the
54 left).
55 * `\b{end-half}`: half of a Unicode end-of-word boundary (`\W|\z` on the
56 right).
57
58 The `\<` and `\>` are GNU extensions to POSIX regexes. They have been added
59 to the `regex` crate because they enjoy somewhat broad support in other regex
60 engines as well (for example, vim). The `\b{start}` and `\b{end}` assertions
61 are aliases for `\<` and `\>`, respectively.
62
63 The `\b{start-half}` and `\b{end-half}` assertions are not found in any
64 other regex engine (although regex engines with general look-around support
65 can certainly express them). They were added principally to support the
66 implementation of word matching in grep programs, where one generally wants to
67 be a bit more flexible in what is considered a word boundary.
68
69 New features:
70
71 * [FEATURE #469](https://github.com/rust-lang/regex/issues/469):
72 Add support for `\<` and `\>` word boundary assertions.
73 * [FEATURE(regex-automata) #1031](https://github.com/rust-lang/regex/pull/1031):
74 DFAs now have a `start_state` method that doesn't use an `Input`.
75
76 Performance improvements:
77
78 * [PERF #1051](https://github.com/rust-lang/regex/pull/1051):
79 Unicode character class operations have been optimized in `regex-syntax`.
80 * [PERF #1090](https://github.com/rust-lang/regex/issues/1090):
81 Make patterns containing lots of literal characters use less memory.
82
83 Bug fixes:
84
85 * [BUG #1046](https://github.com/rust-lang/regex/issues/1046):
86 Fix a bug that could result in incorrect match spans when using a Unicode word
87 boundary and searching non-ASCII strings.
88 * [BUG(regex-syntax) #1047](https://github.com/rust-lang/regex/issues/1047):
89 Fix panics that can occur in `Ast->Hir` translation (not reachable from `regex`
90 crate).
91 * [BUG(regex-syntax) #1088](https://github.com/rust-lang/regex/issues/1088):
92 Remove guarantees in the API that connect the `u` flag with a specific HIR
93 representation.
94
95 `regex-automata` breaking change release:
96
97 This release includes a `regex-automata 0.4.0` breaking change release, which
98 was necessary in order to support the new word boundary assertions. For
99 example, the `Look` enum has new variants and the `LookSet` type now uses `u32`
100 instead of `u16` to represent a bitset of look-around assertions. These are
101 overall very minor changes, and most users of `regex-automata` should be able
102 to move to `0.4` from `0.3` without any changes at all.
103
104 `regex-syntax` breaking change release:
105
106 This release also includes a `regex-syntax 0.8.0` breaking change release,
107 which, like `regex-automata`, was necessary in order to support the new word
108 boundary assertions. This release also includes some changes to the `Ast`
109 type to reduce heap usage in some cases. If you are using the `Ast` type
110 directly, your code may require some minor modifications. Otherwise, users of
111 `regex-syntax 0.7` should be able to migrate to `0.8` without any code changes.
112
113 `regex-lite` release:
114
115 The `regex-lite 0.1.1` release contains support for the new word boundary
116 assertions. There are no breaking changes.
117
118
119 1.9.6 (2023-09-30)
120 ==================
121 This is a patch release that fixes a panic that can occur when the default
122 regex size limit is increased to a large number.
123
124 * [BUG aa4e4c71](https://github.com/rust-lang/regex/commit/aa4e4c7120b0090ce0624e3c42a2ed06dd8b918a):
125 Fix a bug where computing the maximum haystack length for the bounded
126 backtracker could result underflow and thus provoke a panic later in a search
127 due to a broken invariant.
128
129
130 1.9.5 (2023-09-02)
131 ==================
132 This is a patch release that hopefully mostly fixes a performance bug that
133 occurs when sharing a regex across multiple threads.
134
135 Issue [#934](https://github.com/rust-lang/regex/issues/934)
136 explains this in more detail. It is [also noted in the crate
137 documentation](https://docs.rs/regex/latest/regex/#sharing-a-regex-across-threads-can-result-in-contention).
138 The bug can appear when sharing a regex across multiple threads simultaneously,
139 as might be the case when using a regex from a `OnceLock`, `lazy_static` or
140 similar primitive. Usually high contention only results when using many threads
141 to execute searches on small haystacks.
142
143 One can avoid the contention problem entirely through one of two methods.
144 The first is to use lower level APIs from `regex-automata` that require passing
145 state explicitly, such as [`meta::Regex::search_with`](https://docs.rs/regex-automata/latest/regex_automata/meta/struct.Regex.html#method.search_with).
146 The second is to clone a regex and send it to other threads explicitly. This
147 will not use any additional memory usage compared to sharing the regex. The
148 only downside of this approach is that it may be less convenient, for example,
149 it won't work with things like `OnceLock` or `lazy_static` or `once_cell`.
150
151 With that said, as of this release, the contention performance problems have
152 been greatly reduced. This was achieved by changing the free-list so that it
153 was sharded across threads, and that ensuring each sharded mutex occupies a
154 single cache line to mitigate false sharing. So while contention may still
155 impact performance in some cases, it should be a lot better now.
156
157 Because of the changes to how the free-list works, please report any issues you
158 find with this release. That not only includes search time regressions but also
159 significant regressions in memory usage. Reporting improvements is also welcome
160 as well! If possible, provide a reproduction.
161
162 Bug fixes:
163
164 * [BUG #934](https://github.com/rust-lang/regex/issues/934):
165 Fix a performance bug where high contention on a single regex led to massive
166 slow downs.
167
168
169 1.9.4 (2023-08-26)
170 ==================
171 This is a patch release that fixes a bug where `RegexSet::is_match(..)` could
172 incorrectly return false (even when `RegexSet::matches(..).matched_any()`
173 returns true).
174
175 Bug fixes:
176
177 * [BUG #1070](https://github.com/rust-lang/regex/issues/1070):
178 Fix a bug where a prefilter was incorrectly configured for a `RegexSet`.
179
180
181 1.9.3 (2023-08-05)
182 ==================
183 This is a patch release that fixes a bug where some searches could result in
184 incorrect match offsets being reported. It is difficult to characterize the
185 types of regexes susceptible to this bug. They generally involve patterns
186 that contain no prefix or suffix literals, but have an inner literal along with
187 a regex prefix that can conditionally match.
188
189 Bug fixes:
190
191 * [BUG #1060](https://github.com/rust-lang/regex/issues/1060):
192 Fix a bug with the reverse inner literal optimization reporting incorrect match
193 offsets.
194
195
196 1.9.2 (2023-08-05)
197 ==================
198 This is a patch release that fixes another memory usage regression. This
199 particular regression occurred only when using a `RegexSet`. In some cases,
200 much more heap memory (by one or two orders of magnitude) was allocated than in
201 versions prior to 1.9.0.
202
203 Bug fixes:
204
205 * [BUG #1059](https://github.com/rust-lang/regex/issues/1059):
206 Fix a memory usage regression when using a `RegexSet`.
207
208
209 1.9.1 (2023-07-07)
210 ==================
211 This is a patch release which fixes a memory usage regression. In the regex
212 1.9 release, one of the internal engines used a more aggressive allocation
213 strategy than what was done previously. This patch release reverts to the
214 prior on-demand strategy.
215
216 Bug fixes:
217
218 * [BUG #1027](https://github.com/rust-lang/regex/issues/1027):
219 Change the allocation strategy for the backtracker to be less aggressive.
220
221
222 1.9.0 (2023-07-05)
223 ==================
224 This release marks the end of a [years long rewrite of the regex crate
225 internals](https://github.com/rust-lang/regex/issues/656). Since this is
226 such a big release, please report any issues or regressions you find. We would
227 also love to hear about improvements as well.
228
229 In addition to many internal improvements that should hopefully result in
230 "my regex searches are faster," there have also been a few API additions:
231
232 * A new `Captures::extract` method for quickly accessing the substrings
233 that match each capture group in a regex.
234 * A new inline flag, `R`, which enables CRLF mode. This makes `.` match any
235 Unicode scalar value except for `\r` and `\n`, and also makes `(?m:^)` and
236 `(?m:$)` match after and before both `\r` and `\n`, respectively, but never
237 between a `\r` and `\n`.
238 * `RegexBuilder::line_terminator` was added to further customize the line
239 terminator used by `(?m:^)` and `(?m:$)` to be any arbitrary byte.
240 * The `std` Cargo feature is now actually optional. That is, the `regex` crate
241 can be used without the standard library.
242 * Because `regex 1.9` may make binary size and compile times even worse, a
243 new experimental crate called `regex-lite` has been published. It prioritizes
244 binary size and compile times over functionality (like Unicode) and
245 performance. It shares no code with the `regex` crate.
246
247 New features:
248
249 * [FEATURE #244](https://github.com/rust-lang/regex/issues/244):
250 One can opt into CRLF mode via the `R` flag.
251 e.g., `(?mR:$)` matches just before `\r\n`.
252 * [FEATURE #259](https://github.com/rust-lang/regex/issues/259):
253 Multi-pattern searches with offsets can be done with `regex-automata 0.3`.
254 * [FEATURE #476](https://github.com/rust-lang/regex/issues/476):
255 `std` is now an optional feature. `regex` may be used with only `alloc`.
256 * [FEATURE #644](https://github.com/rust-lang/regex/issues/644):
257 `RegexBuilder::line_terminator` configures how `(?m:^)` and `(?m:$)` behave.
258 * [FEATURE #675](https://github.com/rust-lang/regex/issues/675):
259 Anchored search APIs are now available in `regex-automata 0.3`.
260 * [FEATURE #824](https://github.com/rust-lang/regex/issues/824):
261 Add new `Captures::extract` method for easier capture group access.
262 * [FEATURE #961](https://github.com/rust-lang/regex/issues/961):
263 Add `regex-lite` crate with smaller binary sizes and faster compile times.
264 * [FEATURE #1022](https://github.com/rust-lang/regex/pull/1022):
265 Add `TryFrom` implementations for the `Regex` type.
266
267 Performance improvements:
268
269 * [PERF #68](https://github.com/rust-lang/regex/issues/68):
270 Added a one-pass DFA engine for faster capture group matching.
271 * [PERF #510](https://github.com/rust-lang/regex/issues/510):
272 Inner literals are now used to accelerate searches, e.g., `\w+@\w+` will scan
273 for `@`.
274 * [PERF #787](https://github.com/rust-lang/regex/issues/787),
275 [PERF #891](https://github.com/rust-lang/regex/issues/891):
276 Makes literal optimizations apply to regexes of the form `\b(foo|bar|quux)\b`.
277
278 (There are many more performance improvements as well, but not all of them have
279 specific issues devoted to them.)
280
281 Bug fixes:
282
283 * [BUG #429](https://github.com/rust-lang/regex/issues/429):
284 Fix matching bugs related to `\B` and inconsistencies across internal engines.
285 * [BUG #517](https://github.com/rust-lang/regex/issues/517):
286 Fix matching bug with capture groups.
287 * [BUG #579](https://github.com/rust-lang/regex/issues/579):
288 Fix matching bug with word boundaries.
289 * [BUG #779](https://github.com/rust-lang/regex/issues/779):
290 Fix bug where some regexes like `(re)+` were not equivalent to `(re)(re)*`.
291 * [BUG #850](https://github.com/rust-lang/regex/issues/850):
292 Fix matching bug inconsistency between NFA and DFA engines.
293 * [BUG #921](https://github.com/rust-lang/regex/issues/921):
294 Fix matching bug where literal extraction got confused by `$`.
295 * [BUG #976](https://github.com/rust-lang/regex/issues/976):
296 Add documentation to replacement routines about dealing with fallibility.
297 * [BUG #1002](https://github.com/rust-lang/regex/issues/1002):
298 Use corpus rejection in fuzz testing.
299
300
301 1.8.4 (2023-06-05)
302 ==================
303 This is a patch release that fixes a bug where `(?-u:\B)` was allowed in
304 Unicode regexes, despite the fact that the current matching engines can report
305 match offsets between the code units of a single UTF-8 encoded codepoint. That
306 in turn means that match offsets that split a codepoint could be reported,
307 which in turn results in panicking when one uses them to slice a `&str`.
308
309 This bug occurred in the transition to `regex 1.8` because the underlying
310 syntactical error that prevented this regex from compiling was intentionally
311 removed. That's because `(?-u:\B)` will be permitted in Unicode regexes in
312 `regex 1.9`, but the matching engines will guarantee to never report match
313 offsets that split a codepoint. When the underlying syntactical error was
314 removed, no code was added to ensure that `(?-u:\B)` didn't compile in the
315 `regex 1.8` transition release. This release, `regex 1.8.4`, adds that code
316 such that `Regex::new(r"(?-u:\B)")` returns to the `regex <1.8` behavior of
317 not compiling. (A `bytes::Regex` can still of course compile it.)
318
319 Bug fixes:
320
321 * [BUG #1006](https://github.com/rust-lang/regex/issues/1006):
322 Fix a bug where `(?-u:\B)` was allowed in Unicode regexes, and in turn could
323 lead to match offsets that split a codepoint in `&str`.
324
325
326 1.8.3 (2023-05-25)
327 ==================
328 This is a patch release that fixes a bug where the regex would report a
329 match at every position even when it shouldn't. This could occur in a very
330 small subset of regexes, usually an alternation of simple literals that
331 have particular properties. (See the issue linked below for a more precise
332 description.)
333
334 Bug fixes:
335
336 * [BUG #999](https://github.com/rust-lang/regex/issues/999):
337 Fix a bug where a match at every position is erroneously reported.
338
339
340 1.8.2 (2023-05-22)
341 ==================
342 This is a patch release that fixes a bug where regex compilation could panic
343 in debug mode for regexes with large counted repetitions. For example,
344 `a{2147483516}{2147483416}{5}` resulted in an integer overflow that wrapped
345 in release mode but panicking in debug mode. Despite the unintended wrapping
346 arithmetic in release mode, it didn't cause any other logical bugs since the
347 errant code was for new analysis that wasn't used yet.
348
349 Bug fixes:
350
351 * [BUG #995](https://github.com/rust-lang/regex/issues/995):
352 Fix a bug where regex compilation with large counted repetitions could panic.
353
354
355 1.8.1 (2023-04-21)
356 ==================
357 This is a patch release that fixes a bug where a regex match could be reported
358 where none was found. Specifically, the bug occurs when a pattern contains some
359 literal prefixes that could be extracted _and_ an optional word boundary in the
360 prefix.
361
362 Bug fixes:
363
364 * [BUG #981](https://github.com/rust-lang/regex/issues/981):
365 Fix a bug where a word boundary could interact with prefix literal
366 optimizations and lead to a false positive match.
367
368
369 1.8.0 (2023-04-20)
370 ==================
371 This is a sizeable release that will be soon followed by another sizeable
372 release. Both of them will combined close over 40 existing issues and PRs.
373
374 This first release, despite its size, essentially represents preparatory work
375 for the second release, which will be even bigger. Namely, this release:
376
377 * Increases the MSRV to Rust 1.60.0, which was released about 1 year ago.
378 * Upgrades its dependency on `aho-corasick` to the recently released 1.0
379 version.
380 * Upgrades its dependency on `regex-syntax` to the simultaneously released
381 `0.7` version. The changes to `regex-syntax` principally revolve around a
382 rewrite of its literal extraction code and a number of simplifications and
383 optimizations to its high-level intermediate representation (HIR).
384
385 The second release, which will follow ~shortly after the release above, will
386 contain a soup-to-nuts rewrite of every regex engine. This will be done by
387 bringing [`regex-automata`](https://github.com/BurntSushi/regex-automata) into
388 this repository, and then changing the `regex` crate to be nothing but an API
389 shim layer on top of `regex-automata`'s API.
390
391 These tandem releases are the culmination of about 3
392 years of on-and-off work that [began in earnest in March
393 2020](https://github.com/rust-lang/regex/issues/656).
394
395 Because of the scale of changes involved in these releases, I would love to
396 hear about your experience. Especially if you notice undocumented changes in
397 behavior or performance changes (positive *or* negative).
398
399 Most changes in the first release are listed below. For more details, please
400 see the commit log, which reflects a linear and decently documented history
401 of all changes.
402
403 New features:
404
405 * [FEATURE #501](https://github.com/rust-lang/regex/issues/501):
406 Permit many more characters to be escaped, even if they have no significance.
407 More specifically, any ASCII character except for `[0-9A-Za-z<>]` can now be
408 escaped. Also, a new routine, `is_escapeable_character`, has been added to
409 `regex-syntax` to query whether a character is escapeable or not.
410 * [FEATURE #547](https://github.com/rust-lang/regex/issues/547):
411 Add `Regex::captures_at`. This fills a hole in the API, but doesn't otherwise
412 introduce any new expressive power.
413 * [FEATURE #595](https://github.com/rust-lang/regex/issues/595):
414 Capture group names are now Unicode-aware. They can now begin with either a `_`
415 or any "alphabetic" codepoint. After the first codepoint, subsequent codepoints
416 can be any sequence of alpha-numeric codepoints, along with `_`, `.`, `[` and
417 `]`. Note that replacement syntax has not changed.
418 * [FEATURE #810](https://github.com/rust-lang/regex/issues/810):
419 Add `Match::is_empty` and `Match::len` APIs.
420 * [FEATURE #905](https://github.com/rust-lang/regex/issues/905):
421 Add an `impl Default for RegexSet`, with the default being the empty set.
422 * [FEATURE #908](https://github.com/rust-lang/regex/issues/908):
423 A new method, `Regex::static_captures_len`, has been added which returns the
424 number of capture groups in the pattern if and only if every possible match
425 always contains the same number of matching groups.
426 * [FEATURE #955](https://github.com/rust-lang/regex/issues/955):
427 Named captures can now be written as `(?<name>re)` in addition to
428 `(?P<name>re)`.
429 * FEATURE: `regex-syntax` now supports empty character classes.
430 * FEATURE: `regex-syntax` now has an optional `std` feature. (This will come
431 to `regex` in the second release.)
432 * FEATURE: The `Hir` type in `regex-syntax` has had a number of simplifications
433 made to it.
434 * FEATURE: `regex-syntax` has support for a new `R` flag for enabling CRLF
435 mode. This will be supported in `regex` proper in the second release.
436 * FEATURE: `regex-syntax` now has proper support for "regex that never
437 matches" via `Hir::fail()`.
438 * FEATURE: The `hir::literal` module of `regex-syntax` has been completely
439 re-worked. It now has more documentation, examples and advice.
440 * FEATURE: The `allow_invalid_utf8` option in `regex-syntax` has been renamed
441 to `utf8`, and the meaning of the boolean has been flipped.
442
443 Performance improvements:
444
445 * PERF: The upgrade to `aho-corasick 1.0` may improve performance in some
446 cases. It's difficult to characterize exactly which patterns this might impact,
447 but if there are a small number of longish (>= 4 bytes) prefix literals, then
448 it might be faster than before.
449
450 Bug fixes:
451
452 * [BUG #514](https://github.com/rust-lang/regex/issues/514):
453 Improve `Debug` impl for `Match` so that it doesn't show the entire haystack.
454 * BUGS [#516](https://github.com/rust-lang/regex/issues/516),
455 [#731](https://github.com/rust-lang/regex/issues/731):
456 Fix a number of issues with printing `Hir` values as regex patterns.
457 * [BUG #610](https://github.com/rust-lang/regex/issues/610):
458 Add explicit example of `foo|bar` in the regex syntax docs.
459 * [BUG #625](https://github.com/rust-lang/regex/issues/625):
460 Clarify that `SetMatches::len` does not (regretably) refer to the number of
461 matches in the set.
462 * [BUG #660](https://github.com/rust-lang/regex/issues/660):
463 Clarify "verbose mode" in regex syntax documentation.
464 * BUG [#738](https://github.com/rust-lang/regex/issues/738),
465 [#950](https://github.com/rust-lang/regex/issues/950):
466 Fix `CaptureLocations::get` so that it never panics.
467 * [BUG #747](https://github.com/rust-lang/regex/issues/747):
468 Clarify documentation for `Regex::shortest_match`.
469 * [BUG #835](https://github.com/rust-lang/regex/issues/835):
470 Fix `\p{Sc}` so that it is equivalent to `\p{Currency_Symbol}`.
471 * [BUG #846](https://github.com/rust-lang/regex/issues/846):
472 Add more clarifying documentation to the `CompiledTooBig` error variant.
473 * [BUG #854](https://github.com/rust-lang/regex/issues/854):
474 Clarify that `regex::Regex` searches as if the haystack is a sequence of
475 Unicode scalar values.
476 * [BUG #884](https://github.com/rust-lang/regex/issues/884):
477 Replace `__Nonexhaustive` variants with `#[non_exhaustive]` attribute.
478 * [BUG #893](https://github.com/rust-lang/regex/pull/893):
479 Optimize case folding since it can get quite slow in some pathological cases.
480 * [BUG #895](https://github.com/rust-lang/regex/issues/895):
481 Reject `(?-u:\W)` in `regex::Regex` APIs.
482 * [BUG #942](https://github.com/rust-lang/regex/issues/942):
483 Add a missing `void` keyword to indicate "no parameters" in C API.
484 * [BUG #965](https://github.com/rust-lang/regex/issues/965):
485 Fix `\p{Lc}` so that it is equivalent to `\p{Cased_Letter}`.
486 * [BUG #975](https://github.com/rust-lang/regex/issues/975):
487 Clarify documentation for `\pX` syntax.
488
489
490 1.7.3 (2023-03-24)
491 ==================
492 This is a small release that fixes a bug in `Regex::shortest_match_at` that
493 could cause it to panic, even when the offset given is valid.
494
495 Bug fixes:
496
497 * [BUG #969](https://github.com/rust-lang/regex/issues/969):
498 Fix a bug in how the reverse DFA was called for `Regex::shortest_match_at`.
499
500
501 1.7.2 (2023-03-21)
502 ==================
503 This is a small release that fixes a failing test on FreeBSD.
504
505 Bug fixes:
506
507 * [BUG #967](https://github.com/rust-lang/regex/issues/967):
508 Fix "no stack overflow" test which can fail due to the small stack size.
509
510
511 1.7.1 (2023-01-09)
512 ==================
513 This release was done principally to try and fix the doc.rs rendering for the
514 regex crate.
515
516 Performance improvements:
517
518 * [PERF #930](https://github.com/rust-lang/regex/pull/930):
519 Optimize `replacen`. This also applies to `replace`, but not `replace_all`.
520
521 Bug fixes:
522
523 * [BUG #945](https://github.com/rust-lang/regex/issues/945):
524 Maybe fix rustdoc rendering by just bumping a new release?
525
526
527 1.7.0 (2022-11-05)
528 ==================
529 This release principally includes an upgrade to Unicode 15.
530
531 New features:
532
533 * [FEATURE #832](https://github.com/rust-lang/regex/issues/916):
534 Upgrade to Unicode 15.
535
536
537 1.6.0 (2022-07-05)
538 ==================
539 This release principally includes an upgrade to Unicode 14.
540
541 New features:
542
543 * [FEATURE #832](https://github.com/rust-lang/regex/pull/832):
544 Clarify that `Captures::len` includes all groups, not just matching groups.
545 * [FEATURE #857](https://github.com/rust-lang/regex/pull/857):
546 Add an `ExactSizeIterator` impl for `SubCaptureMatches`.
547 * [FEATURE #861](https://github.com/rust-lang/regex/pull/861):
548 Improve `RegexSet` documentation examples.
549 * [FEATURE #877](https://github.com/rust-lang/regex/issues/877):
550 Upgrade to Unicode 14.
551
552 Bug fixes:
553
554 * [BUG #792](https://github.com/rust-lang/regex/issues/792):
555 Fix error message rendering bug.
556
557
558 1.5.6 (2022-05-20)
559 ==================
560 This release includes a few bug fixes, including a bug that produced incorrect
561 matches when a non-greedy `?` operator was used.
562
563 * [BUG #680](https://github.com/rust-lang/regex/issues/680):
564 Fixes a bug where `[[:alnum:][:^ascii:]]` dropped `[:alnum:]` from the class.
565 * [BUG #859](https://github.com/rust-lang/regex/issues/859):
566 Fixes a bug where `Hir::is_match_empty` returned `false` for `\b`.
567 * [BUG #862](https://github.com/rust-lang/regex/issues/862):
568 Fixes a bug where 'ab??' matches 'ab' instead of 'a' in 'ab'.
569
570
571 1.5.5 (2022-03-08)
572 ==================
573 This releases fixes a security bug in the regex compiler. This bug permits a
574 vector for a denial-of-service attack in cases where the regex being compiled
575 is untrusted. There are no known problems where the regex is itself trusted,
576 including in cases of untrusted haystacks.
577
578 * [SECURITY #GHSA-m5pq-gvj9-9vr8](https://github.com/rust-lang/regex/security/advisories/GHSA-m5pq-gvj9-9vr8):
579 Fixes a bug in the regex compiler where empty sub-expressions subverted the
580 existing mitigations in place to enforce a size limit on compiled regexes.
581 The Rust Security Response WG published an advisory about this:
582 https://groups.google.com/g/rustlang-security-announcements/c/NcNNL1Jq7Yw
583
584
585 1.5.4 (2021-05-06)
586 ==================
587 This release fixes another compilation failure when building regex. This time,
588 the fix is for when the `pattern` feature is enabled, which only works on
589 nightly Rust. CI has been updated to test this case.
590
591 * [BUG #772](https://github.com/rust-lang/regex/pull/772):
592 Fix build when `pattern` feature is enabled.
593
594
595 1.5.3 (2021-05-01)
596 ==================
597 This releases fixes a bug when building regex with only the `unicode-perl`
598 feature. It turns out that while CI was building this configuration, it wasn't
599 actually failing the overall build on a failed compilation.
600
601 * [BUG #769](https://github.com/rust-lang/regex/issues/769):
602 Fix build in `regex-syntax` when only the `unicode-perl` feature is enabled.
603
604
605 1.5.2 (2021-05-01)
606 ==================
607 This release fixes a performance bug when Unicode word boundaries are used.
608 Namely, for certain regexes on certain inputs, it's possible for the lazy DFA
609 to stop searching (causing a fallback to a slower engine) when it doesn't
610 actually need to.
611
612 [PR #768](https://github.com/rust-lang/regex/pull/768) fixes the bug, which was
613 originally reported in
614 [ripgrep#1860](https://github.com/BurntSushi/ripgrep/issues/1860).
615
616
617 1.5.1 (2021-04-30)
618 ==================
619 This is a patch release that fixes a compilation error when the `perf-literal`
620 feature is not enabled.
621
622
623 1.5.0 (2021-04-30)
624 ==================
625 This release primarily updates to Rust 2018 (finally) and bumps the MSRV to
626 Rust 1.41 (from Rust 1.28). Rust 1.41 was chosen because it's still reasonably
627 old, and is what's in Debian stable at the time of writing.
628
629 This release also drops this crate's own bespoke substring search algorithms
630 in favor of a new
631 [`memmem` implementation provided by the `memchr` crate](https://docs.rs/memchr/2.4.0/memchr/memmem/index.html).
632 This will change the performance profile of some regexes, sometimes getting a
633 little worse, and hopefully more frequently, getting a lot better. Please
634 report any serious performance regressions if you find them.
635
636
637 1.4.6 (2021-04-22)
638 ==================
639 This is a small patch release that fixes the compiler's size check on how much
640 heap memory a regex uses. Previously, the compiler did not account for the
641 heap usage of Unicode character classes. Now it does. It's possible that this
642 may make some regexes fail to compile that previously did compile. If that
643 happens, please file an issue.
644
645 * [BUG OSS-fuzz#33579](https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33579):
646 Some regexes can use more heap memory than one would expect.
647
648
649 1.4.5 (2021-03-14)
650 ==================
651 This is a small patch release that fixes a regression in the size of a `Regex`
652 in the 1.4.4 release. Prior to 1.4.4, a `Regex` was 552 bytes. In the 1.4.4
653 release, it was 856 bytes due to internal changes. In this release, a `Regex`
654 is now 16 bytes. In general, the size of a `Regex` was never something that was
655 on my radar, but this increased size in the 1.4.4 release seems to have crossed
656 a threshold and resulted in stack overflows in some programs.
657
658 * [BUG #750](https://github.com/rust-lang/regex/pull/750):
659 Fixes stack overflows seemingly caused by a large `Regex` size by decreasing
660 its size.
661
662
663 1.4.4 (2021-03-11)
664 ==================
665 This is a small patch release that contains some bug fixes. Notably, it also
666 drops the `thread_local` (and `lazy_static`, via transitivity) dependencies.
667
668 Bug fixes:
669
670 * [BUG #362](https://github.com/rust-lang/regex/pull/362):
671 Memory leaks caused by an internal caching strategy should now be fixed.
672 * [BUG #576](https://github.com/rust-lang/regex/pull/576):
673 All regex types now implement `UnwindSafe` and `RefUnwindSafe`.
674 * [BUG #728](https://github.com/rust-lang/regex/pull/749):
675 Add missing `Replacer` impls for `Vec<u8>`, `String`, `Cow`, etc.
676
677
678 1.4.3 (2021-01-08)
679 ==================
680 This is a small patch release that adds some missing standard trait
681 implementations for some types in the public API.
682
683 Bug fixes:
684
685 * [BUG #734](https://github.com/rust-lang/regex/pull/734):
686 Add `FusedIterator` and `ExactSizeIterator` impls to iterator types.
687 * [BUG #735](https://github.com/rust-lang/regex/pull/735):
688 Add missing `Debug` impls to public API types.
689
690
691 1.4.2 (2020-11-01)
692 ==================
693 This is a small bug fix release that bans `\P{any}`. We previously banned empty
694 classes like `[^\w\W]`, but missed the `\P{any}` case. In the future, we hope
695 to permit empty classes.
696
697 * [BUG #722](https://github.com/rust-lang/regex/issues/722):
698 Ban `\P{any}` to avoid a panic in the regex compiler. Found by OSS-Fuzz.
699
700
701 1.4.1 (2020-10-13)
702 ==================
703 This is a small bug fix release that makes `\p{cf}` work. Previously, it would
704 report "property not found" even though `cf` is a valid abbreviation for the
705 `Format` general category.
706
707 * [BUG #719](https://github.com/rust-lang/regex/issues/719):
708 Fixes bug that prevented `\p{cf}` from working.
709
710
711 1.4.0 (2020-10-11)
712 ==================
713 This releases has a few minor documentation fixes as well as some very minor
714 API additions. The MSRV remains at Rust 1.28 for now, but this is intended to
715 increase to at least Rust 1.41.1 soon.
716
717 This release also adds support for OSS-Fuzz. Kudos to
718 [@DavidKorczynski](https://github.com/DavidKorczynski)
719 for doing the heavy lifting for that!
720
721 New features:
722
723 * [FEATURE #649](https://github.com/rust-lang/regex/issues/649):
724 Support `[`, `]` and `.` in capture group names.
725 * [FEATURE #687](https://github.com/rust-lang/regex/issues/687):
726 Add `is_empty` predicate to `RegexSet`.
727 * [FEATURE #689](https://github.com/rust-lang/regex/issues/689):
728 Implement `Clone` for `SubCaptureMatches`.
729 * [FEATURE #715](https://github.com/rust-lang/regex/issues/715):
730 Add `empty` constructor to `RegexSet` for convenience.
731
732 Bug fixes:
733
734 * [BUG #694](https://github.com/rust-lang/regex/issues/694):
735 Fix doc example for `Replacer::replace_append`.
736 * [BUG #698](https://github.com/rust-lang/regex/issues/698):
737 Clarify docs for `s` flag when using a `bytes::Regex`.
738 * [BUG #711](https://github.com/rust-lang/regex/issues/711):
739 Clarify `is_match` docs to indicate that it can match anywhere in string.
740
741
742 1.3.9 (2020-05-28)
743 ==================
744 This release fixes a MSRV (Minimum Support Rust Version) regression in the
745 1.3.8 release. Namely, while 1.3.8 compiles on Rust 1.28, it actually does not
746 compile on other Rust versions, such as Rust 1.39.
747
748 Bug fixes:
749
750 * [BUG #685](https://github.com/rust-lang/regex/issues/685):
751 Remove use of `doc_comment` crate, which cannot be used before Rust 1.43.
752
753
754 1.3.8 (2020-05-28)
755 ==================
756 This release contains a couple of important bug fixes driven
757 by better support for empty-subexpressions in regexes. For
758 example, regexes like `b|` are now allowed. Major thanks to
759 [@sliquister](https://github.com/sliquister) for implementing support for this
760 in [#677](https://github.com/rust-lang/regex/pull/677).
761
762 Bug fixes:
763
764 * [BUG #523](https://github.com/rust-lang/regex/pull/523):
765 Add note to documentation that spaces can be escaped in `x` mode.
766 * [BUG #524](https://github.com/rust-lang/regex/issues/524):
767 Add support for empty sub-expressions, including empty alternations.
768 * [BUG #659](https://github.com/rust-lang/regex/issues/659):
769 Fix match bug caused by an empty sub-expression miscompilation.
770
771
772 1.3.7 (2020-04-17)
773 ==================
774 This release contains a small bug fix that fixes how `regex` forwards crate
775 features to `regex-syntax`. In particular, this will reduce recompilations in
776 some cases.
777
778 Bug fixes:
779
780 * [BUG #665](https://github.com/rust-lang/regex/pull/665):
781 Fix feature forwarding to `regex-syntax`.
782
783
784 1.3.6 (2020-03-24)
785 ==================
786 This release contains a sizable (~30%) performance improvement when compiling
787 some kinds of large regular expressions.
788
789 Performance improvements:
790
791 * [PERF #657](https://github.com/rust-lang/regex/pull/657):
792 Improvement performance of compiling large regular expressions.
793
794
795 1.3.5 (2020-03-12)
796 ==================
797 This release updates this crate to Unicode 13.
798
799 New features:
800
801 * [FEATURE #653](https://github.com/rust-lang/regex/pull/653):
802 Update `regex-syntax` to Unicode 13.
803
804
805 1.3.4 (2020-01-30)
806 ==================
807 This is a small bug fix release that fixes a bug related to the scoping of
808 flags in a regex. Namely, before this fix, a regex like `((?i)a)b)` would
809 match `aB` despite the fact that `b` should not be matched case insensitively.
810
811 Bug fixes:
812
813 * [BUG #640](https://github.com/rust-lang/regex/issues/640):
814 Fix bug related to the scoping of flags in a regex.
815
816
817 1.3.3 (2020-01-09)
818 ==================
819 This is a small maintenance release that upgrades the dependency on
820 `thread_local` from `0.3` to `1.0`. The minimum supported Rust version remains
821 at Rust 1.28.
822
823
824 1.3.2 (2020-01-09)
825 ==================
826 This is a small maintenance release with some house cleaning and bug fixes.
827
828 New features:
829
830 * [FEATURE #631](https://github.com/rust-lang/regex/issues/631):
831 Add a `Match::range` method an a `From<Match> for Range` impl.
832
833 Bug fixes:
834
835 * [BUG #521](https://github.com/rust-lang/regex/issues/521):
836 Corrects `/-/.splitn("a", 2)` to return `["a"]` instead of `["a", ""]`.
837 * [BUG #594](https://github.com/rust-lang/regex/pull/594):
838 Improve error reporting when writing `\p\`.
839 * [BUG #627](https://github.com/rust-lang/regex/issues/627):
840 Corrects `/-/.split("a-")` to return `["a", ""]` instead of `["a"]`.
841 * [BUG #633](https://github.com/rust-lang/regex/pull/633):
842 Squash deprecation warnings for the `std::error::Error::description` method.
843
844
845 1.3.1 (2019-09-04)
846 ==================
847 This is a maintenance release with no changes in order to try to work-around
848 a [docs.rs/Cargo issue](https://github.com/rust-lang/docs.rs/issues/400).
849
850
851 1.3.0 (2019-09-03)
852 ==================
853 This release adds a plethora of new crate features that permit users of regex
854 to shrink its size considerably, in exchange for giving up either functionality
855 (such as Unicode support) or runtime performance. When all such features are
856 disabled, the dependency tree for `regex` shrinks to exactly 1 crate
857 (`regex-syntax`). More information about the new crate features can be
858 [found in the docs](https://docs.rs/regex/*/#crate-features).
859
860 Note that while this is a new minor version release, the minimum supported
861 Rust version for this crate remains at `1.28.0`.
862
863 New features:
864
865 * [FEATURE #474](https://github.com/rust-lang/regex/issues/474):
866 The `use_std` feature has been deprecated in favor of the `std` feature.
867 The `use_std` feature will be removed in regex 2. Until then, `use_std` will
868 remain as an alias for the `std` feature.
869 * [FEATURE #583](https://github.com/rust-lang/regex/issues/583):
870 Add a substantial number of crate features shrinking `regex`.
871
872
873 1.2.1 (2019-08-03)
874 ==================
875 This release does a bit of house cleaning. Namely:
876
877 * This repository is now using rustfmt.
878 * License headers have been removed from all files, in following suit with the
879 Rust project.
880 * Teddy has been removed from the `regex` crate, and is now part of the
881 `aho-corasick` crate.
882 [See `aho-corasick`'s new `packed` sub-module for details](https://docs.rs/aho-corasick/0.7.6/aho_corasick/packed/index.html).
883 * The `utf8-ranges` crate has been deprecated, with its functionality moving
884 into the
885 [`utf8` sub-module of `regex-syntax`](https://docs.rs/regex-syntax/0.6.11/regex_syntax/utf8/index.html).
886 * The `ucd-util` dependency has been dropped, in favor of implementing what
887 little we need inside of `regex-syntax` itself.
888
889 In general, this is part of an ongoing (long term) effort to make optimizations
890 in the regex engine easier to reason about. The current code is too convoluted
891 and thus it is very easy to introduce new bugs. This simplification effort is
892 the primary motivation behind re-working the `aho-corasick` crate to not only
893 bundle algorithms like Teddy, but to also provide regex-like match semantics
894 automatically.
895
896 Moving forward, the plan is to join up with the `bstr` and `regex-automata`
897 crates, with the former providing more sophisticated substring search
898 algorithms (thereby deleting existing code in `regex`) and the latter providing
899 ahead-of-time compiled DFAs for cases where they are inexpensive to compute.
900
901
902 1.2.0 (2019-07-20)
903 ==================
904 This release updates regex's minimum supported Rust version to 1.28, which was
905 release almost 1 year ago. This release also updates regex's Unicode data
906 tables to 12.1.0.
907
908
909 1.1.9 (2019-07-06)
910 ==================
911 This release contains a bug fix that caused regex's tests to fail, due to a
912 dependency on an unreleased behavior in regex-syntax.
913
914 * [BUG #593](https://github.com/rust-lang/regex/issues/593):
915 Move an integration-style test on error messages into regex-syntax.
916
917
918 1.1.8 (2019-07-04)
919 ==================
920 This release contains a few small internal refactorings. One of which fixes
921 an instance of undefined behavior in a part of the SIMD code.
922
923 Bug fixes:
924
925 * [BUG #545](https://github.com/rust-lang/regex/issues/545):
926 Improves error messages when a repetition operator is used without a number.
927 * [BUG #588](https://github.com/rust-lang/regex/issues/588):
928 Removes use of a repr(Rust) union used for type punning in the Teddy matcher.
929 * [BUG #591](https://github.com/rust-lang/regex/issues/591):
930 Update docs for running benchmarks and improve failure modes.
931
932
933 1.1.7 (2019-06-09)
934 ==================
935 This release fixes up a few warnings as a result of recent deprecations.
936
937
938 1.1.6 (2019-04-16)
939 ==================
940 This release fixes a regression introduced by a bug fix (for
941 [BUG #557](https://github.com/rust-lang/regex/issues/557)) which could cause
942 the regex engine to enter an infinite loop. This bug was originally
943 [reported against ripgrep](https://github.com/BurntSushi/ripgrep/issues/1247).
944
945
946 1.1.5 (2019-04-01)
947 ==================
948 This release fixes a bug in regex's dependency specification where it requires
949 a newer version of regex-syntax, but this wasn't communicated correctly in the
950 Cargo.toml. This would have been caught by a minimal version check, but this
951 check was disabled because the `rand` crate itself advertises incorrect
952 dependency specifications.
953
954 Bug fixes:
955
956 * [BUG #570](https://github.com/rust-lang/regex/pull/570):
957 Fix regex-syntax minimal version.
958
959
960 1.1.4 (2019-03-31)
961 ==================
962 This release fixes a backwards compatibility regression where Regex was no
963 longer UnwindSafe. This was caused by the upgrade to aho-corasick 0.7, whose
964 AhoCorasick type was itself not UnwindSafe. This has been fixed in aho-corasick
965 0.7.4, which we now require.
966
967 Bug fixes:
968
969 * [BUG #568](https://github.com/rust-lang/regex/pull/568):
970 Fix an API regression where Regex was no longer UnwindSafe.
971
972
973 1.1.3 (2019-03-30)
974 ==================
975 This releases fixes a few bugs and adds a performance improvement when a regex
976 is a simple alternation of literals.
977
978 Performance improvements:
979
980 * [OPT #566](https://github.com/rust-lang/regex/pull/566):
981 Upgrades `aho-corasick` to 0.7 and uses it for `foo|bar|...|quux` regexes.
982
983 Bug fixes:
984
985 * [BUG #527](https://github.com/rust-lang/regex/issues/527):
986 Fix a bug where the parser would panic on patterns like `((?x))`.
987 * [BUG #555](https://github.com/rust-lang/regex/issues/555):
988 Fix a bug where the parser would panic on patterns like `(?m){1,1}`.
989 * [BUG #557](https://github.com/rust-lang/regex/issues/557):
990 Fix a bug where captures could lead to an incorrect match.
991
992
993 1.1.2 (2019-02-27)
994 ==================
995 This release fixes a bug found in the fix introduced in 1.1.1.
996
997 Bug fixes:
998
999 * [BUG edf45e6f](https://github.com/rust-lang/regex/commit/edf45e6f):
1000 Fix bug introduced in reverse suffix literal matcher in the 1.1.1 release.
1001
1002
1003 1.1.1 (2019-02-27)
1004 ==================
1005 This is a small release with one fix for a bug caused by literal optimizations.
1006
1007 Bug fixes:
1008
1009 * [BUG 661bf53d](https://github.com/rust-lang/regex/commit/661bf53d):
1010 Fixes a bug in the reverse suffix literal optimization. This was originally
1011 reported
1012 [against ripgrep](https://github.com/BurntSushi/ripgrep/issues/1203).
1013
1014
1015 1.1.0 (2018-11-30)
1016 ==================
1017 This is a small release with a couple small enhancements. This release also
1018 increases the minimal supported Rust version (MSRV) to 1.24.1 (from 1.20.0). In
1019 accordance with this crate's MSRV policy, this release bumps the minor version
1020 number.
1021
1022 Performance improvements:
1023
1024 * [OPT #511](https://github.com/rust-lang/regex/pull/511),
1025 [OPT #540](https://github.com/rust-lang/regex/pull/540):
1026 Improve lazy DFA construction for large regex sets.
1027
1028 New features:
1029
1030 * [FEATURE #538](https://github.com/rust-lang/regex/pull/538):
1031 Add Emoji and "break" Unicode properties. See [UNICODE.md](UNICODE.md).
1032
1033 Bug fixes:
1034
1035 * [BUG #530](https://github.com/rust-lang/regex/pull/530):
1036 Add Unicode license (for data tables).
1037 * Various typo/doc fixups.
1038
1039
1040 1.0.6 (2018-11-06)
1041 ==================
1042 This is a small release.
1043
1044 Performance improvements:
1045
1046 * [OPT #513](https://github.com/rust-lang/regex/pull/513):
1047 Improve performance of compiling large Unicode classes by 8-10%.
1048
1049 Bug fixes:
1050
1051 * [BUG #533](https://github.com/rust-lang/regex/issues/533):
1052 Fix definition of `[[:blank:]]` class that regressed in `regex-syntax 0.5`.
1053
1054
1055 1.0.5 (2018-09-06)
1056 ==================
1057 This is a small release with an API enhancement.
1058
1059 New features:
1060
1061 * [FEATURE #509](https://github.com/rust-lang/regex/pull/509):
1062 Generalize impls of the `Replacer` trait.
1063
1064
1065 1.0.4 (2018-08-25)
1066 ==================
1067 This is a small release that bumps the quickcheck dependency.
1068
1069
1070 1.0.3 (2018-08-24)
1071 ==================
1072 This is a small bug fix release.
1073
1074 Bug fixes:
1075
1076 * [BUG #504](https://github.com/rust-lang/regex/pull/504):
1077 Fix for Cargo's "minimal version" support.
1078 * [BUG 1e39165f](https://github.com/rust-lang/regex/commit/1e39165f):
1079 Fix doc examples for byte regexes.
1080
1081
1082 1.0.2 (2018-07-18)
1083 ==================
1084 This release exposes some new lower level APIs on `Regex` that permit
1085 amortizing allocation and controlling the location at which a search is
1086 performed in a more granular way. Most users of the regex crate will not
1087 need or want to use these APIs.
1088
1089 New features:
1090
1091 * [FEATURE #493](https://github.com/rust-lang/regex/pull/493):
1092 Add a few lower level APIs for amortizing allocation and more fine grained
1093 searching.
1094
1095 Bug fixes:
1096
1097 * [BUG 3981d2ad](https://github.com/rust-lang/regex/commit/3981d2ad):
1098 Correct outdated documentation on `RegexBuilder::dot_matches_new_line`.
1099 * [BUG 7ebe4ae0](https://github.com/rust-lang/regex/commit/7ebe4ae0):
1100 Correct outdated documentation on `Parser::allow_invalid_utf8` in the
1101 `regex-syntax` crate.
1102 * [BUG 24c7770b](https://github.com/rust-lang/regex/commit/24c7770b):
1103 Fix a bug in the HIR printer where it wouldn't correctly escape meta
1104 characters in character classes.
1105
1106
1107 1.0.1 (2018-06-19)
1108 ==================
1109 This release upgrades regex's Unicode tables to Unicode 11, and enables SIMD
1110 optimizations automatically on Rust stable (1.27 or newer).
1111
1112 New features:
1113
1114 * [FEATURE #486](https://github.com/rust-lang/regex/pull/486):
1115 Implement `size_hint` on `RegexSet` match iterators.
1116 * [FEATURE #488](https://github.com/rust-lang/regex/pull/488):
1117 Update Unicode tables for Unicode 11.
1118 * [FEATURE #490](https://github.com/rust-lang/regex/pull/490):
1119 SIMD optimizations are now enabled automatically in Rust stable, for versions
1120 1.27 and up. No compilation flags or features need to be set. CPU support
1121 SIMD is detected automatically at runtime.
1122
1123 Bug fixes:
1124
1125 * [BUG #482](https://github.com/rust-lang/regex/pull/482):
1126 Present a better compilation error when the `use_std` feature isn't used.
1127
1128
1129 1.0.0 (2018-05-01)
1130 ==================
1131 This release marks the 1.0 release of regex.
1132
1133 While this release includes some breaking changes, most users of older versions
1134 of the regex library should be able to migrate to 1.0 by simply bumping the
1135 version number. The important changes are as follows:
1136
1137 * We adopt Rust 1.20 as the new minimum supported version of Rust for regex.
1138 We also tentativley adopt a policy that permits bumping the minimum supported
1139 version of Rust in minor version releases of regex, but no patch releases.
1140 That is, with respect to semver, we do not strictly consider bumping the
1141 minimum version of Rust to be a breaking change, but adopt a conservative
1142 stance as a compromise.
1143 * Octal syntax in regular expressions has been disabled by default. This
1144 permits better error messages that inform users that backreferences aren't
1145 available. Octal syntax can be re-enabled via the corresponding option on
1146 `RegexBuilder`.
1147 * `(?-u:\B)` is no longer allowed in Unicode regexes since it can match at
1148 invalid UTF-8 code unit boundaries. `(?-u:\b)` is still allowed in Unicode
1149 regexes.
1150 * The `From<regex_syntax::Error>` impl has been removed. This formally removes
1151 the public dependency on `regex-syntax`.
1152 * A new feature, `use_std`, has been added and enabled by default. Disabling
1153 the feature will result in a compilation error. In the future, this may
1154 permit us to support `no_std` environments (w/ `alloc`) in a backwards
1155 compatible way.
1156
1157 For more information and discussion, please see
1158 [1.0 release tracking issue](https://github.com/rust-lang/regex/issues/457).
1159
1160
1161 0.2.11 (2018-05-01)
1162 ===================
1163 This release primarily contains bug fixes. Some of them resolve bugs where
1164 the parser could panic.
1165
1166 New features:
1167
1168 * [FEATURE #459](https://github.com/rust-lang/regex/pull/459):
1169 Include C++'s standard regex library and Boost's regex library in the
1170 benchmark harness. We now include D/libphobos, C++/std, C++/boost, Oniguruma,
1171 PCRE1, PCRE2, RE2 and Tcl in the harness.
1172
1173 Bug fixes:
1174
1175 * [BUG #445](https://github.com/rust-lang/regex/issues/445):
1176 Clarify order of indices returned by RegexSet match iterator.
1177 * [BUG #461](https://github.com/rust-lang/regex/issues/461):
1178 Improve error messages for invalid regexes like `[\d-a]`.
1179 * [BUG #464](https://github.com/rust-lang/regex/issues/464):
1180 Fix a bug in the error message pretty printer that could cause a panic when
1181 a regex contained a literal `\n` character.
1182 * [BUG #465](https://github.com/rust-lang/regex/issues/465):
1183 Fix a panic in the parser that was caused by applying a repetition operator
1184 to `(?flags)`.
1185 * [BUG #466](https://github.com/rust-lang/regex/issues/466):
1186 Fix a bug where `\pC` was not recognized as an alias for `\p{Other}`.
1187 * [BUG #470](https://github.com/rust-lang/regex/pull/470):
1188 Fix a bug where literal searches did more work than necessary for anchored
1189 regexes.
1190
1191
1192 0.2.10 (2018-03-16)
1193 ===================
1194 This release primarily updates the regex crate to changes made in `std::arch`
1195 on nightly Rust.
1196
1197 New features:
1198
1199 * [FEATURE #458](https://github.com/rust-lang/regex/pull/458):
1200 The `Hir` type in `regex-syntax` now has a printer.
1201
1202
1203 0.2.9 (2018-03-12)
1204 ==================
1205 This release introduces a new nightly only feature, `unstable`, which enables
1206 SIMD optimizations for certain types of regexes. No additional compile time
1207 options are necessary, and the regex crate will automatically choose the
1208 best CPU features at run time. As a result, the `simd` (nightly only) crate
1209 dependency has been dropped.
1210
1211 New features:
1212
1213 * [FEATURE #456](https://github.com/rust-lang/regex/pull/456):
1214 The regex crate now includes AVX2 optimizations in addition to the extant
1215 SSSE3 optimization.
1216
1217 Bug fixes:
1218
1219 * [BUG #455](https://github.com/rust-lang/regex/pull/455):
1220 Fix a bug where `(?x)[ / - ]` failed to parse.
1221
1222
1223 0.2.8 (2018-03-12)
1224 ==================
1225 Bug gixes:
1226
1227 * [BUG #454](https://github.com/rust-lang/regex/pull/454):
1228 Fix a bug in the nest limit checker being too aggressive.
1229
1230
1231 0.2.7 (2018-03-07)
1232 ==================
1233 This release includes a ground-up rewrite of the regex-syntax crate, which has
1234 been in development for over a year.
1235 731
1236 New features:
1237
1238 * Error messages for invalid regexes have been greatly improved. You get these
1239 automatically; you don't need to do anything. In addition to better
1240 formatting, error messages will now explicitly call out the use of look
1241 around. When regex 1.0 is released, this will happen for backreferences as
1242 well.
1243 * Full support for intersection, difference and symmetric difference of
1244 character classes. These can be used via the `&&`, `--` and `~~` binary
1245 operators within classes.
1246 * A Unicode Level 1 conformat implementation of `\p{..}` character classes.
1247 Things like `\p{scx:Hira}`, `\p{age:3.2}` or `\p{Changes_When_Casefolded}`
1248 now work. All property name and value aliases are supported, and properties
1249 are selected via loose matching. e.g., `\p{Greek}` is the same as
1250 `\p{G r E e K}`.
1251 * A new `UNICODE.md` document has been added to this repository that
1252 exhaustively documents support for UTS#18.
1253 * Empty sub-expressions are now permitted in most places. That is, `()+` is
1254 now a valid regex.
1255 * Almost everything in regex-syntax now uses constant stack space, even when
1256 performing analysis that requires structural induction. This reduces the risk
1257 of a user provided regular expression causing a stack overflow.
1258 * [FEATURE #174](https://github.com/rust-lang/regex/issues/174):
1259 The `Ast` type in `regex-syntax` now contains span information.
1260 * [FEATURE #424](https://github.com/rust-lang/regex/issues/424):
1261 Support `\u`, `\u{...}`, `\U` and `\U{...}` syntax for specifying code points
1262 in a regular expression.
1263 * [FEATURE #449](https://github.com/rust-lang/regex/pull/449):
1264 Add a `Replace::by_ref` adapter for use of a replacer without consuming it.
1265
1266 Bug fixes:
1267
1268 * [BUG #446](https://github.com/rust-lang/regex/issues/446):
1269 We re-enable the Boyer-Moore literal matcher.
1270
1271
1272 0.2.6 (2018-02-08)
1273 ==================
1274 Bug fixes:
1275
1276 * [BUG #446](https://github.com/rust-lang/regex/issues/446):
1277 Fixes a bug in the new Boyer-Moore searcher that results in a match failure.
1278 We fix this bug by temporarily disabling Boyer-Moore.
1279
1280
1281 0.2.5 (2017-12-30)
1282 ==================
1283 Bug fixes:
1284
1285 * [BUG #437](https://github.com/rust-lang/regex/issues/437):
1286 Fixes a bug in the new Boyer-Moore searcher that results in a panic.
1287
1288
1289 0.2.4 (2017-12-30)
1290 ==================
1291 New features:
1292
1293 * [FEATURE #348](https://github.com/rust-lang/regex/pull/348):
1294 Improve performance for capture searches on anchored regex.
1295 (Contributed by @ethanpailes. Nice work!)
1296 * [FEATURE #419](https://github.com/rust-lang/regex/pull/419):
1297 Expand literal searching to include Tuned Boyer-Moore in some cases.
1298 (Contributed by @ethanpailes. Nice work!)
1299
1300 Bug fixes:
1301
1302 * [BUG](https://github.com/rust-lang/regex/pull/436):
1303 The regex compiler plugin has been removed.
1304 * [BUG](https://github.com/rust-lang/regex/pull/436):
1305 `simd` has been bumped to `0.2.1`, which fixes a Rust nightly build error.
1306 * [BUG](https://github.com/rust-lang/regex/pull/436):
1307 Bring the benchmark harness up to date.
1308
1309
1310 0.2.3 (2017-11-30)
1311 ==================
1312 New features:
1313
1314 * [FEATURE #374](https://github.com/rust-lang/regex/pull/374):
1315 Add `impl From<Match> for &str`.
1316 * [FEATURE #380](https://github.com/rust-lang/regex/pull/380):
1317 Derive `Clone` and `PartialEq` on `Error`.
1318 * [FEATURE #400](https://github.com/rust-lang/regex/pull/400):
1319 Update to Unicode 10.
1320
1321 Bug fixes:
1322
1323 * [BUG #375](https://github.com/rust-lang/regex/issues/375):
1324 Fix a bug that prevented the bounded backtracker from terminating.
1325 * [BUG #393](https://github.com/rust-lang/regex/issues/393),
1326 [BUG #394](https://github.com/rust-lang/regex/issues/394):
1327 Fix bug with `replace` methods for empty matches.
1328
1329
1330 0.2.2 (2017-05-21)
1331 ==================
1332 New features:
1333
1334 * [FEATURE #341](https://github.com/rust-lang/regex/issues/341):
1335 Support nested character classes and intersection operation.
1336 For example, `[\p{Greek}&&\pL]` matches greek letters and
1337 `[[0-9]&&[^4]]` matches every decimal digit except `4`.
1338 (Much thanks to @robinst, who contributed this awesome feature.)
1339
1340 Bug fixes:
1341
1342 * [BUG #321](https://github.com/rust-lang/regex/issues/321):
1343 Fix bug in literal extraction and UTF-8 decoding.
1344 * [BUG #326](https://github.com/rust-lang/regex/issues/326):
1345 Add documentation tip about the `(?x)` flag.
1346 * [BUG #333](https://github.com/rust-lang/regex/issues/333):
1347 Show additional replacement example using curly braces.
1348 * [BUG #334](https://github.com/rust-lang/regex/issues/334):
1349 Fix bug when resolving captures after a match.
1350 * [BUG #338](https://github.com/rust-lang/regex/issues/338):
1351 Add example that uses `Captures::get` to API documentation.
1352 * [BUG #353](https://github.com/rust-lang/regex/issues/353):
1353 Fix RegexSet bug that caused match failure in some cases.
1354 * [BUG #354](https://github.com/rust-lang/regex/pull/354):
1355 Fix panic in parser when `(?x)` is used.
1356 * [BUG #358](https://github.com/rust-lang/regex/issues/358):
1357 Fix literal optimization bug with RegexSet.
1358 * [BUG #359](https://github.com/rust-lang/regex/issues/359):
1359 Fix example code in README.
1360 * [BUG #365](https://github.com/rust-lang/regex/pull/365):
1361 Fix bug in `rure_captures_len` in the C binding.
1362 * [BUG #367](https://github.com/rust-lang/regex/issues/367):
1363 Fix byte class bug that caused a panic.
1364
1365
1366 0.2.1
1367 =====
1368 One major bug with `replace_all` has been fixed along with a couple of other
1369 touchups.
1370
1371 * [BUG #312](https://github.com/rust-lang/regex/issues/312):
1372 Fix documentation for `NoExpand` to reference correct lifetime parameter.
1373 * [BUG #314](https://github.com/rust-lang/regex/issues/314):
1374 Fix a bug with `replace_all` when replacing a match with the empty string.
1375 * [BUG #316](https://github.com/rust-lang/regex/issues/316):
1376 Note a missing breaking change from the `0.2.0` CHANGELOG entry.
1377 (`RegexBuilder::compile` was renamed to `RegexBuilder::build`.)
1378 * [BUG #324](https://github.com/rust-lang/regex/issues/324):
1379 Compiling `regex` should only require one version of `memchr` crate.
1380
1381
1382 0.2.0
1383 =====
1384 This is a new major release of the regex crate, and is an implementation of the
1385 [regex 1.0 RFC](https://github.com/rust-lang/rfcs/blob/master/text/1620-regex-1.0.md).
1386 We are releasing a `0.2` first, and if there are no major problems, we will
1387 release a `1.0` shortly. For `0.2`, the minimum *supported* Rust version is
1388 1.12.
1389
1390 There are a number of **breaking changes** in `0.2`. They are split into two
1391 types. The first type correspond to breaking changes in regular expression
1392 syntax. The second type correspond to breaking changes in the API.
1393
1394 Breaking changes for regex syntax:
1395
1396 * POSIX character classes now require double bracketing. Previously, the regex
1397 `[:upper:]` would parse as the `upper` POSIX character class. Now it parses
1398 as the character class containing the characters `:upper:`. The fix to this
1399 change is to use `[[:upper:]]` instead. Note that variants like
1400 `[[:upper:][:blank:]]` continue to work.
1401 * The character `[` must always be escaped inside a character class.
1402 * The characters `&`, `-` and `~` must be escaped if any one of them are
1403 repeated consecutively. For example, `[&]`, `[\&]`, `[\&\&]`, `[&-&]` are all
1404 equivalent while `[&&]` is illegal. (The motivation for this and the prior
1405 change is to provide a backwards compatible path for adding character class
1406 set notation.)
1407 * A `bytes::Regex` now has Unicode mode enabled by default (like the main
1408 `Regex` type). This means regexes compiled with `bytes::Regex::new` that
1409 don't have the Unicode flag set should add `(?-u)` to recover the original
1410 behavior.
1411
1412 Breaking changes for the regex API:
1413
1414 * `find` and `find_iter` now **return `Match` values instead of
1415 `(usize, usize)`.** `Match` values have `start` and `end` methods, which
1416 return the match offsets. `Match` values also have an `as_str` method,
1417 which returns the text of the match itself.
1418 * The `Captures` type now only provides a single iterator over all capturing
1419 matches, which should replace uses of `iter` and `iter_pos`. Uses of
1420 `iter_named` should use the `capture_names` method on `Regex`.
1421 * The `at` method on the `Captures` type has been renamed to `get`, and it
1422 now returns a `Match`. Similarly, the `name` method on `Captures` now returns
1423 a `Match`.
1424 * The `replace` methods now return `Cow` values. The `Cow::Borrowed` variant
1425 is returned when no replacements are made.
1426 * The `Replacer` trait has been completely overhauled. This should only
1427 impact clients that implement this trait explicitly. Standard uses of
1428 the `replace` methods should continue to work unchanged. If you implement
1429 the `Replacer` trait, please consult the new documentation.
1430 * The `quote` free function has been renamed to `escape`.
1431 * The `Regex::with_size_limit` method has been removed. It is replaced by
1432 `RegexBuilder::size_limit`.
1433 * The `RegexBuilder` type has switched from owned `self` method receivers to
1434 `&mut self` method receivers. Most uses will continue to work unchanged, but
1435 some code may require naming an intermediate variable to hold the builder.
1436 * The `compile` method on `RegexBuilder` has been renamed to `build`.
1437 * The free `is_match` function has been removed. It is replaced by compiling
1438 a `Regex` and calling its `is_match` method.
1439 * The `PartialEq` and `Eq` impls on `Regex` have been dropped. If you relied
1440 on these impls, the fix is to define a wrapper type around `Regex`, impl
1441 `Deref` on it and provide the necessary impls.
1442 * The `is_empty` method on `Captures` has been removed. This always returns
1443 `false`, so its use is superfluous.
1444 * The `Syntax` variant of the `Error` type now contains a string instead of
1445 a `regex_syntax::Error`. If you were examining syntax errors more closely,
1446 you'll need to explicitly use the `regex_syntax` crate to re-parse the regex.
1447 * The `InvalidSet` variant of the `Error` type has been removed since it is
1448 no longer used.
1449 * Most of the iterator types have been renamed to match conventions. If you
1450 were using these iterator types explicitly, please consult the documentation
1451 for its new name. For example, `RegexSplits` has been renamed to `Split`.
1452
1453 A number of bugs have been fixed:
1454
1455 * [BUG #151](https://github.com/rust-lang/regex/issues/151):
1456 The `Replacer` trait has been changed to permit the caller to control
1457 allocation.
1458 * [BUG #165](https://github.com/rust-lang/regex/issues/165):
1459 Remove the free `is_match` function.
1460 * [BUG #166](https://github.com/rust-lang/regex/issues/166):
1461 Expose more knobs (available in `0.1`) and remove `with_size_limit`.
1462 * [BUG #168](https://github.com/rust-lang/regex/issues/168):
1463 Iterators produced by `Captures` now have the correct lifetime parameters.
1464 * [BUG #175](https://github.com/rust-lang/regex/issues/175):
1465 Fix a corner case in the parsing of POSIX character classes.
1466 * [BUG #178](https://github.com/rust-lang/regex/issues/178):
1467 Drop the `PartialEq` and `Eq` impls on `Regex`.
1468 * [BUG #179](https://github.com/rust-lang/regex/issues/179):
1469 Remove `is_empty` from `Captures` since it always returns false.
1470 * [BUG #276](https://github.com/rust-lang/regex/issues/276):
1471 Position of named capture can now be retrieved from a `Captures`.
1472 * [BUG #296](https://github.com/rust-lang/regex/issues/296):
1473 Remove winapi/kernel32-sys dependency on UNIX.
1474 * [BUG #307](https://github.com/rust-lang/regex/issues/307):
1475 Fix error on emscripten.
1476
1477
1478 0.1.80
1479 ======
1480 * [PR #292](https://github.com/rust-lang/regex/pull/292):
1481 Fixes bug #291, which was introduced by PR #290.
1482
1483 0.1.79
1484 ======
1485 * Require regex-syntax 0.3.8.
1486
1487 0.1.78
1488 ======
1489 * [PR #290](https://github.com/rust-lang/regex/pull/290):
1490 Fixes bug #289, which caused some regexes with a certain combination
1491 of literals to match incorrectly.
1492
1493 0.1.77
1494 ======
1495 * [PR #281](https://github.com/rust-lang/regex/pull/281):
1496 Fixes bug #280 by disabling all literal optimizations when a pattern
1497 is partially anchored.
1498
1499 0.1.76
1500 ======
1501 * Tweak criteria for using the Teddy literal matcher.
1502
1503 0.1.75
1504 ======
1505 * [PR #275](https://github.com/rust-lang/regex/pull/275):
1506 Improves match verification performance in the Teddy SIMD searcher.
1507 * [PR #278](https://github.com/rust-lang/regex/pull/278):
1508 Replaces slow substring loop in the Teddy SIMD searcher with Aho-Corasick.
1509 * Implemented DoubleEndedIterator on regex set match iterators.
1510
1511 0.1.74
1512 ======
1513 * Release regex-syntax 0.3.5 with a minor bug fix.
1514 * Fix bug #272.
1515 * Fix bug #277.
1516 * [PR #270](https://github.com/rust-lang/regex/pull/270):
1517 Fixes bugs #264, #268 and an unreported where the DFA cache size could be
1518 drastically under estimated in some cases (leading to high unexpected memory
1519 usage).
1520
1521 0.1.73
1522 ======
1523 * Release `regex-syntax 0.3.4`.
1524 * Bump `regex-syntax` dependency version for `regex` to `0.3.4`.
1525
1526 0.1.72
1527 ======
1528 * [PR #262](https://github.com/rust-lang/regex/pull/262):
1529 Fixes a number of small bugs caught by fuzz testing (AFL).
1530
1531 0.1.71
1532 ======
1533 * [PR #236](https://github.com/rust-lang/regex/pull/236):
1534 Fix a bug in how suffix literals were extracted, which could lead
1535 to invalid match behavior in some cases.
1536
1537 0.1.70
1538 ======
1539 * [PR #231](https://github.com/rust-lang/regex/pull/231):
1540 Add SIMD accelerated multiple pattern search.
1541 * [PR #228](https://github.com/rust-lang/regex/pull/228):
1542 Reintroduce the reverse suffix literal optimization.
1543 * [PR #226](https://github.com/rust-lang/regex/pull/226):
1544 Implements NFA state compression in the lazy DFA.
1545 * [PR #223](https://github.com/rust-lang/regex/pull/223):
1546 A fully anchored RegexSet can now short-circuit.
1547
1548 0.1.69
1549 ======
1550 * [PR #216](https://github.com/rust-lang/regex/pull/216):
1551 Tweak the threshold for running backtracking.
1552 * [PR #217](https://github.com/rust-lang/regex/pull/217):
1553 Add upper limit (from the DFA) to capture search (for the NFA).
1554 * [PR #218](https://github.com/rust-lang/regex/pull/218):
1555 Add rure, a C API.
1556
1557 0.1.68
1558 ======
1559 * [PR #210](https://github.com/rust-lang/regex/pull/210):
1560 Fixed a performance bug in `bytes::Regex::replace` where `extend` was used
1561 instead of `extend_from_slice`.
1562 * [PR #211](https://github.com/rust-lang/regex/pull/211):
1563 Fixed a bug in the handling of word boundaries in the DFA.
1564 * [PR #213](https://github.com/rust-lang/pull/213):
1565 Added RE2 and Tcl to the benchmark harness. Also added a CLI utility from
1566 running regexes using any of the following regex engines: PCRE1, PCRE2,
1567 Oniguruma, RE2, Tcl and of course Rust's own regexes.
1568
1569 0.1.67
1570 ======
1571 * [PR #201](https://github.com/rust-lang/regex/pull/201):
1572 Fix undefined behavior in the `regex!` compiler plugin macro.
1573 * [PR #205](https://github.com/rust-lang/regex/pull/205):
1574 More improvements to DFA performance. Competitive with RE2. See PR for
1575 benchmarks.
1576 * [PR #209](https://github.com/rust-lang/regex/pull/209):
1577 Release 0.1.66 was semver incompatible since it required a newer version
1578 of Rust than previous releases. This PR fixes that. (And `0.1.66` was
1579 yanked.)
1580
1581 0.1.66
1582 ======
1583 * Speculative support for Unicode word boundaries was added to the DFA. This
1584 should remove the last common case that disqualified use of the DFA.
1585 * An optimization that scanned for suffix literals and then matched the regular
1586 expression in reverse was removed because it had worst case quadratic time
1587 complexity. It was replaced with a more limited optimization where, given any
1588 regex of the form `re$`, it will be matched in reverse from the end of the
1589 haystack.
1590 * [PR #202](https://github.com/rust-lang/regex/pull/202):
1591 The inner loop of the DFA was heavily optimized to improve cache locality
1592 and reduce the overall number of instructions run on each iteration. This
1593 represents the first use of `unsafe` in `regex` (to elide bounds checks).
1594 * [PR #200](https://github.com/rust-lang/regex/pull/200):
1595 Use of the `mempool` crate (which used thread local storage) was replaced
1596 with a faster version of a similar API in @Amanieu's `thread_local` crate.
1597 It should reduce contention when using a regex from multiple threads
1598 simultaneously.
1599 * PCRE2 JIT benchmarks were added. A benchmark comparison can be found
1600 [here](https://gist.github.com/anonymous/14683c01993e91689f7206a18675901b).
1601 (Includes a comparison with PCRE1's JIT and Oniguruma.)
1602 * A bug where word boundaries weren't being matched correctly in the DFA was
1603 fixed. This only affected use of `bytes::Regex`.
1604 * [#160](https://github.com/rust-lang/regex/issues/160):
1605 `Captures` now has a `Debug` impl.