Debian Codegraph @

third_party/rust/regex/CHANGELOG.md

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