11.5.4 (2021-05-06) 2================== 3This release fixes another compilation failure when building regex. This time, 4the fix is for when the `pattern` feature is enabled, which only works on 5nightly Rust. CI has been updated to test this case. 6 7* [BUG #772](https://github.com/rust-lang/regex/pull/772): 8 Fix build when `pattern` feature is enabled. 9 10 111.5.3 (2021-05-01) 12================== 13This releases fixes a bug when building regex with only the `unicode-perl` 14feature. It turns out that while CI was building this configuration, it wasn't 15actually failing the overall build on a failed compilation. 16 17* [BUG #769](https://github.com/rust-lang/regex/issues/769): 18 Fix build in `regex-syntax` when only the `unicode-perl` feature is enabled. 19 20 211.5.2 (2021-05-01) 22================== 23This release fixes a performance bug when Unicode word boundaries are used. 24Namely, for certain regexes on certain inputs, it's possible for the lazy DFA 25to stop searching (causing a fallback to a slower engine) when it doesn't 26actually need to. 27 28[PR #768](https://github.com/rust-lang/regex/pull/768) fixes the bug, which was 29originally reported in 30[ripgrep#1860](https://github.com/BurntSushi/ripgrep/issues/1860). 31 32 331.5.1 (2021-04-30) 34================== 35This is a patch release that fixes a compilation error when the `perf-literal` 36feature is not enabled. 37 38 391.5.0 (2021-04-30) 40================== 41This release primarily updates to Rust 2018 (finally) and bumps the MSRV to 42Rust 1.41 (from Rust 1.28). Rust 1.41 was chosen because it's still reasonably 43old, and is what's in Debian stable at the time of writing. 44 45This release also drops this crate's own bespoke substring search algorithms 46in favor of a new 47[`memmem` implementation provided by the `memchr` crate](https://docs.rs/memchr/2.4.0/memchr/memmem/index.html). 48This will change the performance profile of some regexes, sometimes getting a 49little worse, and hopefully more frequently, getting a lot better. Please 50report any serious performance regressions if you find them. 51 52 531.4.6 (2021-04-22) 54================== 55This is a small patch release that fixes the compiler's size check on how much 56heap memory a regex uses. Previously, the compiler did not account for the 57heap usage of Unicode character classes. Now it does. It's possible that this 58may make some regexes fail to compile that previously did compile. If that 59happens, please file an issue. 60 61* [BUG OSS-fuzz#33579](https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33579): 62 Some regexes can use more heap memory than one would expect. 63 64 651.4.5 (2021-03-14) 66================== 67This is a small patch release that fixes a regression in the size of a `Regex` 68in the 1.4.4 release. Prior to 1.4.4, a `Regex` was 552 bytes. In the 1.4.4 69release, it was 856 bytes due to internal changes. In this release, a `Regex` 70is now 16 bytes. In general, the size of a `Regex` was never something that was 71on my radar, but this increased size in the 1.4.4 release seems to have crossed 72a threshold and resulted in stack overflows in some programs. 73 74* [BUG #750](https://github.com/rust-lang/regex/pull/750): 75 Fixes stack overflows seemingly caused by a large `Regex` size by decreasing 76 its size. 77 78 791.4.4 (2021-03-11) 80================== 81This is a small patch release that contains some bug fixes. Notably, it also 82drops the `thread_local` (and `lazy_static`, via transitivity) dependencies. 83 84Bug fixes: 85 86* [BUG #362](https://github.com/rust-lang/regex/pull/362): 87 Memory leaks caused by an internal caching strategy should now be fixed. 88* [BUG #576](https://github.com/rust-lang/regex/pull/576): 89 All regex types now implement `UnwindSafe` and `RefUnwindSafe`. 90* [BUG #728](https://github.com/rust-lang/regex/pull/749): 91 Add missing `Replacer` impls for `Vec<u8>`, `String`, `Cow`, etc. 92 93 941.4.3 (2021-01-08) 95================== 96This is a small patch release that adds some missing standard trait 97implementations for some types in the public API. 98 99Bug fixes: 100 101* [BUG #734](https://github.com/rust-lang/regex/pull/734): 102 Add `FusedIterator` and `ExactSizeIterator` impls to iterator types. 103* [BUG #735](https://github.com/rust-lang/regex/pull/735): 104 Add missing `Debug` impls to public API types. 105 106 1071.4.2 (2020-11-01) 108================== 109This is a small bug fix release that bans `\P{any}`. We previously banned empty 110classes like `[^\w\W]`, but missed the `\P{any}` case. In the future, we hope 111to permit empty classes. 112 113* [BUG #722](https://github.com/rust-lang/regex/issues/722): 114 Ban `\P{any}` to avoid a panic in the regex compiler. Found by OSS-Fuzz. 115 116 1171.4.1 (2020-10-13) 118================== 119This is a small bug fix release that makes `\p{cf}` work. Previously, it would 120report "property not found" even though `cf` is a valid abbreviation for the 121`Format` general category. 122 123* [BUG #719](https://github.com/rust-lang/regex/issues/719): 124 Fixes bug that prevented `\p{cf}` from working. 125 126 1271.4.0 (2020-10-11) 128================== 129This releases has a few minor documentation fixes as well as some very minor 130API additions. The MSRV remains at Rust 1.28 for now, but this is intended to 131increase to at least Rust 1.41.1 soon. 132 133This release also adds support for OSS-Fuzz. Kudos to 134[@DavidKorczynski](https://github.com/DavidKorczynski) 135for doing the heavy lifting for that! 136 137New features: 138 139* [FEATURE #649](https://github.com/rust-lang/regex/issues/649): 140 Support `[`, `]` and `.` in capture group names. 141* [FEATURE #687](https://github.com/rust-lang/regex/issues/687): 142 Add `is_empty` predicate to `RegexSet`. 143* [FEATURE #689](https://github.com/rust-lang/regex/issues/689): 144 Implement `Clone` for `SubCaptureMatches`. 145* [FEATURE #715](https://github.com/rust-lang/regex/issues/715): 146 Add `empty` constructor to `RegexSet` for convenience. 147 148Bug fixes: 149 150* [BUG #694](https://github.com/rust-lang/regex/issues/694): 151 Fix doc example for `Replacer::replace_append`. 152* [BUG #698](https://github.com/rust-lang/regex/issues/698): 153 Clarify docs for `s` flag when using a `bytes::Regex`. 154* [BUG #711](https://github.com/rust-lang/regex/issues/711): 155 Clarify `is_match` docs to indicate that it can match anywhere in string. 156 157 1581.3.9 (2020-05-28) 159================== 160This release fixes a MSRV (Minimum Support Rust Version) regression in the 1611.3.8 release. Namely, while 1.3.8 compiles on Rust 1.28, it actually does not 162compile on other Rust versions, such as Rust 1.39. 163 164Bug fixes: 165 166* [BUG #685](https://github.com/rust-lang/regex/issues/685): 167 Remove use of `doc_comment` crate, which cannot be used before Rust 1.43. 168 169 1701.3.8 (2020-05-28) 171================== 172This release contains a couple of important bug fixes driven 173by better support for empty-subexpressions in regexes. For 174example, regexes like `b|` are now allowed. Major thanks to 175[@sliquister](https://github.com/sliquister) for implementing support for this 176in [#677](https://github.com/rust-lang/regex/pull/677). 177 178Bug fixes: 179 180* [BUG #523](https://github.com/rust-lang/regex/pull/523): 181 Add note to documentation that spaces can be escaped in `x` mode. 182* [BUG #524](https://github.com/rust-lang/regex/issues/524): 183 Add support for empty sub-expressions, including empty alternations. 184* [BUG #659](https://github.com/rust-lang/regex/issues/659): 185 Fix match bug caused by an empty sub-expression miscompilation. 186 187 1881.3.7 (2020-04-17) 189================== 190This release contains a small bug fix that fixes how `regex` forwards crate 191features to `regex-syntax`. In particular, this will reduce recompilations in 192some cases. 193 194Bug fixes: 195 196* [BUG #665](https://github.com/rust-lang/regex/pull/665): 197 Fix feature forwarding to `regex-syntax`. 198 199 2001.3.6 (2020-03-24) 201================== 202This release contains a sizable (~30%) performance improvement when compiling 203some kinds of large regular expressions. 204 205Performance improvements: 206 207* [PERF #657](https://github.com/rust-lang/regex/pull/657): 208 Improvement performance of compiling large regular expressions. 209 210 2111.3.5 (2020-03-12) 212================== 213This release updates this crate to Unicode 13. 214 215New features: 216 217* [FEATURE #653](https://github.com/rust-lang/regex/pull/653): 218 Update `regex-syntax` to Unicode 13. 219 220 2211.3.4 (2020-01-30) 222================== 223This is a small bug fix release that fixes a bug related to the scoping of 224flags in a regex. Namely, before this fix, a regex like `((?i)a)b)` would 225match `aB` despite the fact that `b` should not be matched case insensitively. 226 227Bug fixes: 228 229* [BUG #640](https://github.com/rust-lang/regex/issues/640): 230 Fix bug related to the scoping of flags in a regex. 231 232 2331.3.3 (2020-01-09) 234================== 235This is a small maintenance release that upgrades the dependency on 236`thread_local` from `0.3` to `1.0`. The minimum supported Rust version remains 237at Rust 1.28. 238 239 2401.3.2 (2020-01-09) 241================== 242This is a small maintenance release with some house cleaning and bug fixes. 243 244New features: 245 246* [FEATURE #631](https://github.com/rust-lang/regex/issues/631): 247 Add a `Match::range` method an a `From<Match> for Range` impl. 248 249Bug fixes: 250 251* [BUG #521](https://github.com/rust-lang/regex/issues/521): 252 Corrects `/-/.splitn("a", 2)` to return `["a"]` instead of `["a", ""]`. 253* [BUG #594](https://github.com/rust-lang/regex/pull/594): 254 Improve error reporting when writing `\p\`. 255* [BUG #627](https://github.com/rust-lang/regex/issues/627): 256 Corrects `/-/.split("a-")` to return `["a", ""]` instead of `["a"]`. 257* [BUG #633](https://github.com/rust-lang/regex/pull/633): 258 Squash deprecation warnings for the `std::error::Error::description` method. 259 260 2611.3.1 (2019-09-04) 262================== 263This is a maintenance release with no changes in order to try to work-around 264a [docs.rs/Cargo issue](https://github.com/rust-lang/docs.rs/issues/400). 265 266 2671.3.0 (2019-09-03) 268================== 269This release adds a plethora of new crate features that permit users of regex 270to shrink its size considerably, in exchange for giving up either functionality 271(such as Unicode support) or runtime performance. When all such features are 272disabled, the dependency tree for `regex` shrinks to exactly 1 crate 273(`regex-syntax`). More information about the new crate features can be 274[found in the docs](https://docs.rs/regex/*/#crate-features). 275 276Note that while this is a new minor version release, the minimum supported 277Rust version for this crate remains at `1.28.0`. 278 279New features: 280 281* [FEATURE #474](https://github.com/rust-lang/regex/issues/474): 282 The `use_std` feature has been deprecated in favor of the `std` feature. 283 The `use_std` feature will be removed in regex 2. Until then, `use_std` will 284 remain as an alias for the `std` feature. 285* [FEATURE #583](https://github.com/rust-lang/regex/issues/583): 286 Add a substantial number of crate features shrinking `regex`. 287 288 2891.2.1 (2019-08-03) 290================== 291This release does a bit of house cleaning. Namely: 292 293* This repository is now using rustfmt. 294* License headers have been removed from all files, in following suit with the 295 Rust project. 296* Teddy has been removed from the `regex` crate, and is now part of the 297 `aho-corasick` crate. 298 [See `aho-corasick`'s new `packed` sub-module for details](https://docs.rs/aho-corasick/0.7.6/aho_corasick/packed/index.html). 299* The `utf8-ranges` crate has been deprecated, with its functionality moving 300 into the 301 [`utf8` sub-module of `regex-syntax`](https://docs.rs/regex-syntax/0.6.11/regex_syntax/utf8/index.html). 302* The `ucd-util` dependency has been dropped, in favor of implementing what 303 little we need inside of `regex-syntax` itself. 304 305In general, this is part of an ongoing (long term) effort to make optimizations 306in the regex engine easier to reason about. The current code is too convoluted 307and thus it is very easy to introduce new bugs. This simplification effort is 308the primary motivation behind re-working the `aho-corasick` crate to not only 309bundle algorithms like Teddy, but to also provide regex-like match semantics 310automatically. 311 312Moving forward, the plan is to join up with the `bstr` and `regex-automata` 313crates, with the former providing more sophisticated substring search 314algorithms (thereby deleting existing code in `regex`) and the latter providing 315ahead-of-time compiled DFAs for cases where they are inexpensive to compute. 316 317 3181.2.0 (2019-07-20) 319================== 320This release updates regex's minimum supported Rust version to 1.28, which was 321release almost 1 year ago. This release also updates regex's Unicode data 322tables to 12.1.0. 323 324 3251.1.9 (2019-07-06) 326================== 327This release contains a bug fix that caused regex's tests to fail, due to a 328dependency on an unreleased behavior in regex-syntax. 329 330* [BUG #593](https://github.com/rust-lang/regex/issues/593): 331 Move an integration-style test on error messages into regex-syntax. 332 333 3341.1.8 (2019-07-04) 335================== 336This release contains a few small internal refactorings. One of which fixes 337an instance of undefined behavior in a part of the SIMD code. 338 339Bug fixes: 340 341* [BUG #545](https://github.com/rust-lang/regex/issues/545): 342 Improves error messages when a repetition operator is used without a number. 343* [BUG #588](https://github.com/rust-lang/regex/issues/588): 344 Removes use of a repr(Rust) union used for type punning in the Teddy matcher. 345* [BUG #591](https://github.com/rust-lang/regex/issues/591): 346 Update docs for running benchmarks and improve failure modes. 347 348 3491.1.7 (2019-06-09) 350================== 351This release fixes up a few warnings as a result of recent deprecations. 352 353 3541.1.6 (2019-04-16) 355================== 356This release fixes a regression introduced by a bug fix (for 357[BUG #557](https://github.com/rust-lang/regex/issues/557)) which could cause 358the regex engine to enter an infinite loop. This bug was originally 359[reported against ripgrep](https://github.com/BurntSushi/ripgrep/issues/1247). 360 361 3621.1.5 (2019-04-01) 363================== 364This release fixes a bug in regex's dependency specification where it requires 365a newer version of regex-syntax, but this wasn't communicated correctly in the 366Cargo.toml. This would have been caught by a minimal version check, but this 367check was disabled because the `rand` crate itself advertises incorrect 368dependency specifications. 369 370Bug fixes: 371 372* [BUG #570](https://github.com/rust-lang/regex/pull/570): 373 Fix regex-syntax minimal version. 374 375 3761.1.4 (2019-03-31) 377================== 378This release fixes a backwards compatibility regression where Regex was no 379longer UnwindSafe. This was caused by the upgrade to aho-corasick 0.7, whose 380AhoCorasick type was itself not UnwindSafe. This has been fixed in aho-corasick 3810.7.4, which we now require. 382 383Bug fixes: 384 385* [BUG #568](https://github.com/rust-lang/regex/pull/568): 386 Fix an API regression where Regex was no longer UnwindSafe. 387 388 3891.1.3 (2019-03-30) 390================== 391This releases fixes a few bugs and adds a performance improvement when a regex 392is a simple alternation of literals. 393 394Performance improvements: 395 396* [OPT #566](https://github.com/rust-lang/regex/pull/566): 397 Upgrades `aho-corasick` to 0.7 and uses it for `foo|bar|...|quux` regexes. 398 399Bug fixes: 400 401* [BUG #527](https://github.com/rust-lang/regex/issues/527): 402 Fix a bug where the parser would panic on patterns like `((?x))`. 403* [BUG #555](https://github.com/rust-lang/regex/issues/555): 404 Fix a bug where the parser would panic on patterns like `(?m){1,1}`. 405* [BUG #557](https://github.com/rust-lang/regex/issues/557): 406 Fix a bug where captures could lead to an incorrect match. 407 408 4091.1.2 (2019-02-27) 410================== 411This release fixes a bug found in the fix introduced in 1.1.1. 412 413Bug fixes: 414 415* [BUG edf45e6f](https://github.com/rust-lang/regex/commit/edf45e6f): 416 Fix bug introduced in reverse suffix literal matcher in the 1.1.1 release. 417 418 4191.1.1 (2019-02-27) 420================== 421This is a small release with one fix for a bug caused by literal optimizations. 422 423Bug fixes: 424 425* [BUG 661bf53d](https://github.com/rust-lang/regex/commit/661bf53d): 426 Fixes a bug in the reverse suffix literal optimization. This was originally 427 reported 428 [against ripgrep](https://github.com/BurntSushi/ripgrep/issues/1203). 429 430 4311.1.0 (2018-11-30) 432================== 433This is a small release with a couple small enhancements. This release also 434increases the minimal supported Rust version (MSRV) to 1.24.1 (from 1.20.0). In 435accordance with this crate's MSRV policy, this release bumps the minor version 436number. 437 438Performance improvements: 439 440* [OPT #511](https://github.com/rust-lang/regex/pull/511), 441 [OPT #540](https://github.com/rust-lang/regex/pull/540): 442 Improve lazy DFA construction for large regex sets. 443 444New features: 445 446* [FEATURE #538](https://github.com/rust-lang/regex/pull/538): 447 Add Emoji and "break" Unicode properties. See [UNICODE.md](UNICODE.md). 448 449Bug fixes: 450 451* [BUG #530](https://github.com/rust-lang/regex/pull/530): 452 Add Unicode license (for data tables). 453* Various typo/doc fixups. 454 455 4561.0.6 (2018-11-06) 457================== 458This is a small release. 459 460Performance improvements: 461 462* [OPT #513](https://github.com/rust-lang/regex/pull/513): 463 Improve performance of compiling large Unicode classes by 8-10%. 464 465Bug fixes: 466 467* [BUG #533](https://github.com/rust-lang/regex/issues/533): 468 Fix definition of `[[:blank:]]` class that regressed in `regex-syntax 0.5`. 469 470 4711.0.5 (2018-09-06) 472================== 473This is a small release with an API enhancement. 474 475New features: 476 477* [FEATURE #509](https://github.com/rust-lang/regex/pull/509): 478 Generalize impls of the `Replacer` trait. 479 480 4811.0.4 (2018-08-25) 482================== 483This is a small release that bumps the quickcheck dependency. 484 485 4861.0.3 (2018-08-24) 487================== 488This is a small bug fix release. 489 490Bug fixes: 491 492* [BUG #504](https://github.com/rust-lang/regex/pull/504): 493 Fix for Cargo's "minimal version" support. 494* [BUG 1e39165f](https://github.com/rust-lang/regex/commit/1e39165f): 495 Fix doc examples for byte regexes. 496 497 4981.0.2 (2018-07-18) 499================== 500This release exposes some new lower level APIs on `Regex` that permit 501amortizing allocation and controlling the location at which a search is 502performed in a more granular way. Most users of the regex crate will not 503need or want to use these APIs. 504 505New features: 506 507* [FEATURE #493](https://github.com/rust-lang/regex/pull/493): 508 Add a few lower level APIs for amortizing allocation and more fine grained 509 searching. 510 511Bug fixes: 512 513* [BUG 3981d2ad](https://github.com/rust-lang/regex/commit/3981d2ad): 514 Correct outdated documentation on `RegexBuilder::dot_matches_new_line`. 515* [BUG 7ebe4ae0](https://github.com/rust-lang/regex/commit/7ebe4ae0): 516 Correct outdated documentation on `Parser::allow_invalid_utf8` in the 517 `regex-syntax` crate. 518* [BUG 24c7770b](https://github.com/rust-lang/regex/commit/24c7770b): 519 Fix a bug in the HIR printer where it wouldn't correctly escape meta 520 characters in character classes. 521 522 5231.0.1 (2018-06-19) 524================== 525This release upgrades regex's Unicode tables to Unicode 11, and enables SIMD 526optimizations automatically on Rust stable (1.27 or newer). 527 528New features: 529 530* [FEATURE #486](https://github.com/rust-lang/regex/pull/486): 531 Implement `size_hint` on `RegexSet` match iterators. 532* [FEATURE #488](https://github.com/rust-lang/regex/pull/488): 533 Update Unicode tables for Unicode 11. 534* [FEATURE #490](https://github.com/rust-lang/regex/pull/490): 535 SIMD optimizations are now enabled automatically in Rust stable, for versions 536 1.27 and up. No compilation flags or features need to be set. CPU support 537 SIMD is detected automatically at runtime. 538 539Bug fixes: 540 541* [BUG #482](https://github.com/rust-lang/regex/pull/482): 542 Present a better compilation error when the `use_std` feature isn't used. 543 544 5451.0.0 (2018-05-01) 546================== 547This release marks the 1.0 release of regex. 548 549While this release includes some breaking changes, most users of older versions 550of the regex library should be able to migrate to 1.0 by simply bumping the 551version number. The important changes are as follows: 552 553* We adopt Rust 1.20 as the new minimum supported version of Rust for regex. 554 We also tentativley adopt a policy that permits bumping the minimum supported 555 version of Rust in minor version releases of regex, but no patch releases. 556 That is, with respect to semver, we do not strictly consider bumping the 557 minimum version of Rust to be a breaking change, but adopt a conservative 558 stance as a compromise. 559* Octal syntax in regular expressions has been disabled by default. This 560 permits better error messages that inform users that backreferences aren't 561 available. Octal syntax can be re-enabled via the corresponding option on 562 `RegexBuilder`. 563* `(?-u:\B)` is no longer allowed in Unicode regexes since it can match at 564 invalid UTF-8 code unit boundaries. `(?-u:\b)` is still allowed in Unicode 565 regexes. 566* The `From<regex_syntax::Error>` impl has been removed. This formally removes 567 the public dependency on `regex-syntax`. 568* A new feature, `use_std`, has been added and enabled by default. Disabling 569 the feature will result in a compilation error. In the future, this may 570 permit us to support `no_std` environments (w/ `alloc`) in a backwards 571 compatible way. 572 573For more information and discussion, please see 574[1.0 release tracking issue](https://github.com/rust-lang/regex/issues/457). 575 576 5770.2.11 (2018-05-01) 578=================== 579This release primarily contains bug fixes. Some of them resolve bugs where 580the parser could panic. 581 582New features: 583 584* [FEATURE #459](https://github.com/rust-lang/regex/pull/459): 585 Include C++'s standard regex library and Boost's regex library in the 586 benchmark harness. We now include D/libphobos, C++/std, C++/boost, Oniguruma, 587 PCRE1, PCRE2, RE2 and Tcl in the harness. 588 589Bug fixes: 590 591* [BUG #445](https://github.com/rust-lang/regex/issues/445): 592 Clarify order of indices returned by RegexSet match iterator. 593* [BUG #461](https://github.com/rust-lang/regex/issues/461): 594 Improve error messages for invalid regexes like `[\d-a]`. 595* [BUG #464](https://github.com/rust-lang/regex/issues/464): 596 Fix a bug in the error message pretty printer that could cause a panic when 597 a regex contained a literal `\n` character. 598* [BUG #465](https://github.com/rust-lang/regex/issues/465): 599 Fix a panic in the parser that was caused by applying a repetition operator 600 to `(?flags)`. 601* [BUG #466](https://github.com/rust-lang/regex/issues/466): 602 Fix a bug where `\pC` was not recognized as an alias for `\p{Other}`. 603* [BUG #470](https://github.com/rust-lang/regex/pull/470): 604 Fix a bug where literal searches did more work than necessary for anchored 605 regexes. 606 607 6080.2.10 (2018-03-16) 609=================== 610This release primarily updates the regex crate to changes made in `std::arch` 611on nightly Rust. 612 613New features: 614 615* [FEATURE #458](https://github.com/rust-lang/regex/pull/458): 616 The `Hir` type in `regex-syntax` now has a printer. 617 618 6190.2.9 (2018-03-12) 620================== 621This release introduces a new nightly only feature, `unstable`, which enables 622SIMD optimizations for certain types of regexes. No additional compile time 623options are necessary, and the regex crate will automatically choose the 624best CPU features at run time. As a result, the `simd` (nightly only) crate 625dependency has been dropped. 626 627New features: 628 629* [FEATURE #456](https://github.com/rust-lang/regex/pull/456): 630 The regex crate now includes AVX2 optimizations in addition to the extant 631 SSSE3 optimization. 632 633Bug fixes: 634 635* [BUG #455](https://github.com/rust-lang/regex/pull/455): 636 Fix a bug where `(?x)[ / - ]` failed to parse. 637 638 6390.2.8 (2018-03-12) 640================== 641Bug gixes: 642 643* [BUG #454](https://github.com/rust-lang/regex/pull/454): 644 Fix a bug in the nest limit checker being too aggressive. 645 646 6470.2.7 (2018-03-07) 648================== 649This release includes a ground-up rewrite of the regex-syntax crate, which has 650been in development for over a year. 651 652New features: 653 654* Error messages for invalid regexes have been greatly improved. You get these 655 automatically; you don't need to do anything. In addition to better 656 formatting, error messages will now explicitly call out the use of look 657 around. When regex 1.0 is released, this will happen for backreferences as 658 well. 659* Full support for intersection, difference and symmetric difference of 660 character classes. These can be used via the `&&`, `--` and `~~` binary 661 operators within classes. 662* A Unicode Level 1 conformat implementation of `\p{..}` character classes. 663 Things like `\p{scx:Hira}`, `\p{age:3.2}` or `\p{Changes_When_Casefolded}` 664 now work. All property name and value aliases are supported, and properties 665 are selected via loose matching. e.g., `\p{Greek}` is the same as 666 `\p{G r E e K}`. 667* A new `UNICODE.md` document has been added to this repository that 668 exhaustively documents support for UTS#18. 669* Empty sub-expressions are now permitted in most places. That is, `()+` is 670 now a valid regex. 671* Almost everything in regex-syntax now uses constant stack space, even when 672 performing anaylsis that requires structural induction. This reduces the risk 673 of a user provided regular expression causing a stack overflow. 674* [FEATURE #174](https://github.com/rust-lang/regex/issues/174): 675 The `Ast` type in `regex-syntax` now contains span information. 676* [FEATURE #424](https://github.com/rust-lang/regex/issues/424): 677 Support `\u`, `\u{...}`, `\U` and `\U{...}` syntax for specifying code points 678 in a regular expression. 679* [FEATURE #449](https://github.com/rust-lang/regex/pull/449): 680 Add a `Replace::by_ref` adapter for use of a replacer without consuming it. 681 682Bug fixes: 683 684* [BUG #446](https://github.com/rust-lang/regex/issues/446): 685 We re-enable the Boyer-Moore literal matcher. 686 687 6880.2.6 (2018-02-08) 689================== 690Bug fixes: 691 692* [BUG #446](https://github.com/rust-lang/regex/issues/446): 693 Fixes a bug in the new Boyer-Moore searcher that results in a match failure. 694 We fix this bug by temporarily disabling Boyer-Moore. 695 696 6970.2.5 (2017-12-30) 698================== 699Bug fixes: 700 701* [BUG #437](https://github.com/rust-lang/regex/issues/437): 702 Fixes a bug in the new Boyer-Moore searcher that results in a panic. 703 704 7050.2.4 (2017-12-30) 706================== 707New features: 708 709* [FEATURE #348](https://github.com/rust-lang/regex/pull/348): 710 Improve performance for capture searches on anchored regex. 711 (Contributed by @ethanpailes. Nice work!) 712* [FEATURE #419](https://github.com/rust-lang/regex/pull/419): 713 Expand literal searching to include Tuned Boyer-Moore in some cases. 714 (Contributed by @ethanpailes. Nice work!) 715 716Bug fixes: 717 718* [BUG](https://github.com/rust-lang/regex/pull/436): 719 The regex compiler plugin has been removed. 720* [BUG](https://github.com/rust-lang/regex/pull/436): 721 `simd` has been bumped to `0.2.1`, which fixes a Rust nightly build error. 722* [BUG](https://github.com/rust-lang/regex/pull/436): 723 Bring the benchmark harness up to date. 724 725 7260.2.3 (2017-11-30) 727================== 728New features: 729 730* [FEATURE #374](https://github.com/rust-lang/regex/pull/374): 731 Add `impl From<Match> for &str`. 732* [FEATURE #380](https://github.com/rust-lang/regex/pull/380): 733 Derive `Clone` and `PartialEq` on `Error`. 734* [FEATURE #400](https://github.com/rust-lang/regex/pull/400): 735 Update to Unicode 10. 736 737Bug fixes: 738 739* [BUG #375](https://github.com/rust-lang/regex/issues/375): 740 Fix a bug that prevented the bounded backtracker from terminating. 741* [BUG #393](https://github.com/rust-lang/regex/issues/393), 742 [BUG #394](https://github.com/rust-lang/regex/issues/394): 743 Fix bug with `replace` methods for empty matches. 744 745 7460.2.2 (2017-05-21) 747================== 748New features: 749 750* [FEATURE #341](https://github.com/rust-lang/regex/issues/341): 751 Support nested character classes and intersection operation. 752 For example, `[\p{Greek}&&\pL]` matches greek letters and 753 `[[0-9]&&[^4]]` matches every decimal digit except `4`. 754 (Much thanks to @robinst, who contributed this awesome feature.) 755 756Bug fixes: 757 758* [BUG #321](https://github.com/rust-lang/regex/issues/321): 759 Fix bug in literal extraction and UTF-8 decoding. 760* [BUG #326](https://github.com/rust-lang/regex/issues/326): 761 Add documentation tip about the `(?x)` flag. 762* [BUG #333](https://github.com/rust-lang/regex/issues/333): 763 Show additional replacement example using curly braces. 764* [BUG #334](https://github.com/rust-lang/regex/issues/334): 765 Fix bug when resolving captures after a match. 766* [BUG #338](https://github.com/rust-lang/regex/issues/338): 767 Add example that uses `Captures::get` to API documentation. 768* [BUG #353](https://github.com/rust-lang/regex/issues/353): 769 Fix RegexSet bug that caused match failure in some cases. 770* [BUG #354](https://github.com/rust-lang/regex/pull/354): 771 Fix panic in parser when `(?x)` is used. 772* [BUG #358](https://github.com/rust-lang/regex/issues/358): 773 Fix literal optimization bug with RegexSet. 774* [BUG #359](https://github.com/rust-lang/regex/issues/359): 775 Fix example code in README. 776* [BUG #365](https://github.com/rust-lang/regex/pull/365): 777 Fix bug in `rure_captures_len` in the C binding. 778* [BUG #367](https://github.com/rust-lang/regex/issues/367): 779 Fix byte class bug that caused a panic. 780 781 7820.2.1 783===== 784One major bug with `replace_all` has been fixed along with a couple of other 785touchups. 786 787* [BUG #312](https://github.com/rust-lang/regex/issues/312): 788 Fix documentation for `NoExpand` to reference correct lifetime parameter. 789* [BUG #314](https://github.com/rust-lang/regex/issues/314): 790 Fix a bug with `replace_all` when replacing a match with the empty string. 791* [BUG #316](https://github.com/rust-lang/regex/issues/316): 792 Note a missing breaking change from the `0.2.0` CHANGELOG entry. 793 (`RegexBuilder::compile` was renamed to `RegexBuilder::build`.) 794* [BUG #324](https://github.com/rust-lang/regex/issues/324): 795 Compiling `regex` should only require one version of `memchr` crate. 796 797 7980.2.0 799===== 800This is a new major release of the regex crate, and is an implementation of the 801[regex 1.0 RFC](https://github.com/rust-lang/rfcs/blob/master/text/1620-regex-1.0.md). 802We are releasing a `0.2` first, and if there are no major problems, we will 803release a `1.0` shortly. For `0.2`, the minimum *supported* Rust version is 8041.12. 805 806There are a number of **breaking changes** in `0.2`. They are split into two 807types. The first type correspond to breaking changes in regular expression 808syntax. The second type correspond to breaking changes in the API. 809 810Breaking changes for regex syntax: 811 812* POSIX character classes now require double bracketing. Previously, the regex 813 `[:upper:]` would parse as the `upper` POSIX character class. Now it parses 814 as the character class containing the characters `:upper:`. The fix to this 815 change is to use `[[:upper:]]` instead. Note that variants like 816 `[[:upper:][:blank:]]` continue to work. 817* The character `[` must always be escaped inside a character class. 818* The characters `&`, `-` and `~` must be escaped if any one of them are 819 repeated consecutively. For example, `[&]`, `[\&]`, `[\&\&]`, `[&-&]` are all 820 equivalent while `[&&]` is illegal. (The motivation for this and the prior 821 change is to provide a backwards compatible path for adding character class 822 set notation.) 823* A `bytes::Regex` now has Unicode mode enabled by default (like the main 824 `Regex` type). This means regexes compiled with `bytes::Regex::new` that 825 don't have the Unicode flag set should add `(?-u)` to recover the original 826 behavior. 827 828Breaking changes for the regex API: 829 830* `find` and `find_iter` now **return `Match` values instead of 831 `(usize, usize)`.** `Match` values have `start` and `end` methods, which 832 return the match offsets. `Match` values also have an `as_str` method, 833 which returns the text of the match itself. 834* The `Captures` type now only provides a single iterator over all capturing 835 matches, which should replace uses of `iter` and `iter_pos`. Uses of 836 `iter_named` should use the `capture_names` method on `Regex`. 837* The `at` method on the `Captures` type has been renamed to `get`, and it 838 now returns a `Match`. Similarly, the `name` method on `Captures` now returns 839 a `Match`. 840* The `replace` methods now return `Cow` values. The `Cow::Borrowed` variant 841 is returned when no replacements are made. 842* The `Replacer` trait has been completely overhauled. This should only 843 impact clients that implement this trait explicitly. Standard uses of 844 the `replace` methods should continue to work unchanged. If you implement 845 the `Replacer` trait, please consult the new documentation. 846* The `quote` free function has been renamed to `escape`. 847* The `Regex::with_size_limit` method has been removed. It is replaced by 848 `RegexBuilder::size_limit`. 849* The `RegexBuilder` type has switched from owned `self` method receivers to 850 `&mut self` method receivers. Most uses will continue to work unchanged, but 851 some code may require naming an intermediate variable to hold the builder. 852* The `compile` method on `RegexBuilder` has been renamed to `build`. 853* The free `is_match` function has been removed. It is replaced by compiling 854 a `Regex` and calling its `is_match` method. 855* The `PartialEq` and `Eq` impls on `Regex` have been dropped. If you relied 856 on these impls, the fix is to define a wrapper type around `Regex`, impl 857 `Deref` on it and provide the necessary impls. 858* The `is_empty` method on `Captures` has been removed. This always returns 859 `false`, so its use is superfluous. 860* The `Syntax` variant of the `Error` type now contains a string instead of 861 a `regex_syntax::Error`. If you were examining syntax errors more closely, 862 you'll need to explicitly use the `regex_syntax` crate to re-parse the regex. 863* The `InvalidSet` variant of the `Error` type has been removed since it is 864 no longer used. 865* Most of the iterator types have been renamed to match conventions. If you 866 were using these iterator types explicitly, please consult the documentation 867 for its new name. For example, `RegexSplits` has been renamed to `Split`. 868 869A number of bugs have been fixed: 870 871* [BUG #151](https://github.com/rust-lang/regex/issues/151): 872 The `Replacer` trait has been changed to permit the caller to control 873 allocation. 874* [BUG #165](https://github.com/rust-lang/regex/issues/165): 875 Remove the free `is_match` function. 876* [BUG #166](https://github.com/rust-lang/regex/issues/166): 877 Expose more knobs (available in `0.1`) and remove `with_size_limit`. 878* [BUG #168](https://github.com/rust-lang/regex/issues/168): 879 Iterators produced by `Captures` now have the correct lifetime parameters. 880* [BUG #175](https://github.com/rust-lang/regex/issues/175): 881 Fix a corner case in the parsing of POSIX character classes. 882* [BUG #178](https://github.com/rust-lang/regex/issues/178): 883 Drop the `PartialEq` and `Eq` impls on `Regex`. 884* [BUG #179](https://github.com/rust-lang/regex/issues/179): 885 Remove `is_empty` from `Captures` since it always returns false. 886* [BUG #276](https://github.com/rust-lang/regex/issues/276): 887 Position of named capture can now be retrieved from a `Captures`. 888* [BUG #296](https://github.com/rust-lang/regex/issues/296): 889 Remove winapi/kernel32-sys dependency on UNIX. 890* [BUG #307](https://github.com/rust-lang/regex/issues/307): 891 Fix error on emscripten. 892 893 8940.1.80 895====== 896* [PR #292](https://github.com/rust-lang/regex/pull/292): 897 Fixes bug #291, which was introduced by PR #290. 898 8990.1.79 900====== 901* Require regex-syntax 0.3.8. 902 9030.1.78 904====== 905* [PR #290](https://github.com/rust-lang/regex/pull/290): 906 Fixes bug #289, which caused some regexes with a certain combination 907 of literals to match incorrectly. 908 9090.1.77 910====== 911* [PR #281](https://github.com/rust-lang/regex/pull/281): 912 Fixes bug #280 by disabling all literal optimizations when a pattern 913 is partially anchored. 914 9150.1.76 916====== 917* Tweak criteria for using the Teddy literal matcher. 918 9190.1.75 920====== 921* [PR #275](https://github.com/rust-lang/regex/pull/275): 922 Improves match verification performance in the Teddy SIMD searcher. 923* [PR #278](https://github.com/rust-lang/regex/pull/278): 924 Replaces slow substring loop in the Teddy SIMD searcher with Aho-Corasick. 925* Implemented DoubleEndedIterator on regex set match iterators. 926 9270.1.74 928====== 929* Release regex-syntax 0.3.5 with a minor bug fix. 930* Fix bug #272. 931* Fix bug #277. 932* [PR #270](https://github.com/rust-lang/regex/pull/270): 933 Fixes bugs #264, #268 and an unreported where the DFA cache size could be 934 drastically under estimated in some cases (leading to high unexpected memory 935 usage). 936 9370.1.73 938====== 939* Release `regex-syntax 0.3.4`. 940* Bump `regex-syntax` dependency version for `regex` to `0.3.4`. 941 9420.1.72 943====== 944* [PR #262](https://github.com/rust-lang/regex/pull/262): 945 Fixes a number of small bugs caught by fuzz testing (AFL). 946 9470.1.71 948====== 949* [PR #236](https://github.com/rust-lang/regex/pull/236): 950 Fix a bug in how suffix literals were extracted, which could lead 951 to invalid match behavior in some cases. 952 9530.1.70 954====== 955* [PR #231](https://github.com/rust-lang/regex/pull/231): 956 Add SIMD accelerated multiple pattern search. 957* [PR #228](https://github.com/rust-lang/regex/pull/228): 958 Reintroduce the reverse suffix literal optimization. 959* [PR #226](https://github.com/rust-lang/regex/pull/226): 960 Implements NFA state compression in the lazy DFA. 961* [PR #223](https://github.com/rust-lang/regex/pull/223): 962 A fully anchored RegexSet can now short-circuit. 963 9640.1.69 965====== 966* [PR #216](https://github.com/rust-lang/regex/pull/216): 967 Tweak the threshold for running backtracking. 968* [PR #217](https://github.com/rust-lang/regex/pull/217): 969 Add upper limit (from the DFA) to capture search (for the NFA). 970* [PR #218](https://github.com/rust-lang/regex/pull/218): 971 Add rure, a C API. 972 9730.1.68 974====== 975* [PR #210](https://github.com/rust-lang/regex/pull/210): 976 Fixed a performance bug in `bytes::Regex::replace` where `extend` was used 977 instead of `extend_from_slice`. 978* [PR #211](https://github.com/rust-lang/regex/pull/211): 979 Fixed a bug in the handling of word boundaries in the DFA. 980* [PR #213](https://github.com/rust-lang/pull/213): 981 Added RE2 and Tcl to the benchmark harness. Also added a CLI utility from 982 running regexes using any of the following regex engines: PCRE1, PCRE2, 983 Oniguruma, RE2, Tcl and of course Rust's own regexes. 984 9850.1.67 986====== 987* [PR #201](https://github.com/rust-lang/regex/pull/201): 988 Fix undefined behavior in the `regex!` compiler plugin macro. 989* [PR #205](https://github.com/rust-lang/regex/pull/205): 990 More improvements to DFA performance. Competitive with RE2. See PR for 991 benchmarks. 992* [PR #209](https://github.com/rust-lang/regex/pull/209): 993 Release 0.1.66 was semver incompatible since it required a newer version 994 of Rust than previous releases. This PR fixes that. (And `0.1.66` was 995 yanked.) 996 9970.1.66 998====== 999* Speculative support for Unicode word boundaries was added to the DFA. This 1000 should remove the last common case that disqualified use of the DFA. 1001* An optimization that scanned for suffix literals and then matched the regular 1002 expression in reverse was removed because it had worst case quadratic time 1003 complexity. It was replaced with a more limited optimization where, given any 1004 regex of the form `re$`, it will be matched in reverse from the end of the 1005 haystack. 1006* [PR #202](https://github.com/rust-lang/regex/pull/202): 1007 The inner loop of the DFA was heavily optimized to improve cache locality 1008 and reduce the overall number of instructions run on each iteration. This 1009 represents the first use of `unsafe` in `regex` (to elide bounds checks). 1010* [PR #200](https://github.com/rust-lang/regex/pull/200): 1011 Use of the `mempool` crate (which used thread local storage) was replaced 1012 with a faster version of a similar API in @Amanieu's `thread_local` crate. 1013 It should reduce contention when using a regex from multiple threads 1014 simultaneously. 1015* PCRE2 JIT benchmarks were added. A benchmark comparison can be found 1016 [here](https://gist.github.com/anonymous/14683c01993e91689f7206a18675901b). 1017 (Includes a comparison with PCRE1's JIT and Oniguruma.) 1018* A bug where word boundaries weren't being matched correctly in the DFA was 1019 fixed. This only affected use of `bytes::Regex`. 1020* [#160](https://github.com/rust-lang/regex/issues/160): 1021 `Captures` now has a `Debug` impl. 1022