|
| 1 | +0.2.0 |
| 2 | +===== |
| 3 | +This is a new major release of the regex crate, and is an implementation of the |
| 4 | +[regex 1.0 RFC](https://github.com/rust-lang/rfcs/blob/master/text/1620-regex-1.0.md). |
| 5 | +We are releasing a `0.2` first, and if there are no major problems, we will |
| 6 | +release a `1.0` shortly. For `0.2`, the minimum *supported* Rust version is |
| 7 | +1.12. |
| 8 | + |
| 9 | +There are a number of **breaking changes** in `0.2`. They are split into two |
| 10 | +types. The first type correspond to breaking changes in regular expression |
| 11 | +syntax. The second type correspond to breaking changes in the API. |
| 12 | + |
| 13 | +Breaking changes for regex syntax: |
| 14 | + |
| 15 | +* POSIX character classes now require double bracketing. Previously, the regex |
| 16 | + `[:upper:]` would parse as the `upper` POSIX character class. Now it parses |
| 17 | + as the character class containing the characters `:upper:`. The fix to this |
| 18 | + change is to use `[[:upper:]]` instead. Note that variants like |
| 19 | + `[[:upper:][:blank:]]` continue to work. |
| 20 | +* The character `[` must always be escaped inside a character class. |
| 21 | +* The characters `&`, `-` and `~` must be escaped if any one of them are |
| 22 | + repeated consecutively. For example, `[&]`, `[\&]`, `[\&\&]`, `[&-&]` are all |
| 23 | + equivalent while `[&&]` is illegal. (The motivation for this and the prior |
| 24 | + change is to provide a backwards compatible path for adding character class |
| 25 | + set notation.) |
| 26 | +* A `bytes::Regex` now has Unicode mode enabled by default (like the main |
| 27 | + `Regex` type). This means regexes compiled with `bytes::Regex::new` that |
| 28 | + don't have the Unicode flag set should add `(?-u)` to recover the original |
| 29 | + behavior. |
| 30 | + |
| 31 | +Breaking changes for the regex API: |
| 32 | + |
| 33 | +* `find` and `find_iter` now **return `Match` values instead of |
| 34 | + `(usize, usize)`.** `Match` values have `start` and `end` methods, which |
| 35 | + return the match offsets. `Match` values also have an `as_str` method, |
| 36 | + which returns the text of the match itself. |
| 37 | +* The `Captures` type now only provides a single iterator over all capturing |
| 38 | + matches, which should replace uses of `iter` and `iter_pos`. Uses of |
| 39 | + `iter_named` should use the `capture_names` method on `Regex`. |
| 40 | +* The `at` method on the `Captures` type has been renamed to `get`, and it |
| 41 | + now returns a `Match`. Similarly, the `name` method on `Captures` now returns |
| 42 | + a `Match`. |
| 43 | +* The `replace` methods now return `Cow` values. The `Cow::Borrowed` variant |
| 44 | + is returned when no replacements are made. |
| 45 | +* The `Replacer` trait has been completely overhauled. This should only |
| 46 | + impact clients that implement this trait explicitly. Standard uses of |
| 47 | + the `replace` methods should continue to work unchanged. If you implement |
| 48 | + the `Replacer` trait, please consult the new documentation. |
| 49 | +* The `quote` free function has been renamed to `escape`. |
| 50 | +* The `Regex::with_size_limit` method has been removed. It is replaced by |
| 51 | + `RegexBuilder::size_limit`. |
| 52 | +* The `RegexBuilder` type has switched from owned `self` method receivers to |
| 53 | + `&mut self` method receivers. Most uses will continue to work unchanged, but |
| 54 | + some code may require naming an intermediate variable to hold the builder. |
| 55 | +* The free `is_match` function has been removed. It is replaced by compiling |
| 56 | + a `Regex` and calling its `is_match` method. |
| 57 | +* The `PartialEq` and `Eq` impls on `Regex` have been dropped. If you relied |
| 58 | + on these impls, the fix is to define a wrapper type around `Regex`, impl |
| 59 | + `Deref` on it and provide the necessary impls. |
| 60 | +* The `is_empty` method on `Captures` has been removed. This always returns |
| 61 | + `false`, so its use is superfluous. |
| 62 | +* The `Syntax` variant of the `Error` type now contains a string instead of |
| 63 | + a `regex_syntax::Error`. If you were examining syntax errors more closely, |
| 64 | + you'll need to explicitly use the `regex_syntax` crate to re-parse the regex. |
| 65 | +* The `InvalidSet` variant of the `Error` type has been removed since it is |
| 66 | + no longer used. |
| 67 | +* Most of the iterator types have been renamed to match conventions. If you |
| 68 | + were using these iterator types explicitly, please consult the documentation |
| 69 | + for its new name. For example, `RegexSplits` has been renamed to `Split`. |
| 70 | + |
| 71 | +A number of bugs have been fixed: |
| 72 | + |
| 73 | +* [BUG #151](https://github.com/rust-lang/regex/issues/151): |
| 74 | + The `Replacer` trait has been changed to permit the caller to control |
| 75 | + allocation. |
| 76 | +* [BUG #165](https://github.com/rust-lang/regex/issues/165): |
| 77 | + Remove the free `is_match` function. |
| 78 | +* [BUG #166](https://github.com/rust-lang/regex/issues/166): |
| 79 | + Expose more knobs (available in `0.1`) and remove `with_size_limit`. |
| 80 | +* [BUG #168](https://github.com/rust-lang/regex/issues/168): |
| 81 | + Iterators produced by `Captures` now have the correct lifetime parameters. |
| 82 | +* [BUG #175](https://github.com/rust-lang/regex/issues/175): |
| 83 | + Fix a corner case in the parsing of POSIX character classes. |
| 84 | +* [BUG #178](https://github.com/rust-lang/regex/issues/178): |
| 85 | + Drop the `PartialEq` and `Eq` impls on `Regex`. |
| 86 | +* [BUG #179](https://github.com/rust-lang/regex/issues/179): |
| 87 | + Remove `is_empty` from `Captures` since it always returns false. |
| 88 | +* [BUG #276](https://github.com/rust-lang/regex/issues/276): |
| 89 | + Position of named capture can now be retrieved from a `Captures`. |
| 90 | +* [BUG #296](https://github.com/rust-lang/regex/issues/296): |
| 91 | + Remove winapi/kernel32-sys dependency on UNIX. |
| 92 | +* [BUG #307](https://github.com/rust-lang/regex/issues/307): |
| 93 | + Fix error on emscripten. |
| 94 | + |
| 95 | + |
1 | 96 | 0.1.80
|
2 | 97 | ======
|
3 |
| -* [PR #292](https://github.com/rust-lang-nursery/regex/pull/292): |
| 98 | +* [PR #292](https://github.com/rust-lang/regex/pull/292): |
4 | 99 | Fixes bug #291, which was introduced by PR #290.
|
5 | 100 |
|
6 | 101 | 0.1.79
|
|
9 | 104 |
|
10 | 105 | 0.1.78
|
11 | 106 | ======
|
12 |
| -* [PR #290](https://github.com/rust-lang-nursery/regex/pull/290): |
| 107 | +* [PR #290](https://github.com/rust-lang/regex/pull/290): |
13 | 108 | Fixes bug #289, which caused some regexes with a certain combination
|
14 | 109 | of literals to match incorrectly.
|
15 | 110 |
|
16 | 111 | 0.1.77
|
17 | 112 | ======
|
18 |
| -* [PR #281](https://github.com/rust-lang-nursery/regex/pull/281): |
| 113 | +* [PR #281](https://github.com/rust-lang/regex/pull/281): |
19 | 114 | Fixes bug #280 by disabling all literal optimizations when a pattern
|
20 | 115 | is partially anchored.
|
21 | 116 |
|
|
25 | 120 |
|
26 | 121 | 0.1.75
|
27 | 122 | ======
|
28 |
| -* [PR #275](https://github.com/rust-lang-nursery/regex/pull/275): |
| 123 | +* [PR #275](https://github.com/rust-lang/regex/pull/275): |
29 | 124 | Improves match verification performance in the Teddy SIMD searcher.
|
30 |
| -* [PR #278](https://github.com/rust-lang-nursery/regex/pull/278): |
| 125 | +* [PR #278](https://github.com/rust-lang/regex/pull/278): |
31 | 126 | Replaces slow substring loop in the Teddy SIMD searcher with Aho-Corasick.
|
32 | 127 | * Implemented DoubleEndedIterator on regex set match iterators.
|
33 | 128 |
|
|
36 | 131 | * Release regex-syntax 0.3.5 with a minor bug fix.
|
37 | 132 | * Fix bug #272.
|
38 | 133 | * Fix bug #277.
|
39 |
| -* [PR #270](https://github.com/rust-lang-nursery/regex/pull/270): |
| 134 | +* [PR #270](https://github.com/rust-lang/regex/pull/270): |
40 | 135 | Fixes bugs #264, #268 and an unreported where the DFA cache size could be
|
41 | 136 | drastically under estimated in some cases (leading to high unexpected memory
|
42 | 137 | usage).
|
|
48 | 143 |
|
49 | 144 | 0.1.72
|
50 | 145 | ======
|
51 |
| -* [PR #262](https://github.com/rust-lang-nursery/regex/pull/262): |
| 146 | +* [PR #262](https://github.com/rust-lang/regex/pull/262): |
52 | 147 | Fixes a number of small bugs caught by fuzz testing (AFL).
|
53 | 148 |
|
54 | 149 | 0.1.71
|
55 | 150 | ======
|
56 |
| -* [PR #236](https://github.com/rust-lang-nursery/regex/pull/236): |
| 151 | +* [PR #236](https://github.com/rust-lang/regex/pull/236): |
57 | 152 | Fix a bug in how suffix literals were extracted, which could lead
|
58 | 153 | to invalid match behavior in some cases.
|
59 | 154 |
|
60 | 155 | 0.1.70
|
61 | 156 | ======
|
62 |
| -* [PR #231](https://github.com/rust-lang-nursery/regex/pull/231): |
| 157 | +* [PR #231](https://github.com/rust-lang/regex/pull/231): |
63 | 158 | Add SIMD accelerated multiple pattern search.
|
64 |
| -* [PR #228](https://github.com/rust-lang-nursery/regex/pull/228): |
| 159 | +* [PR #228](https://github.com/rust-lang/regex/pull/228): |
65 | 160 | Reintroduce the reverse suffix literal optimization.
|
66 |
| -* [PR #226](https://github.com/rust-lang-nursery/regex/pull/226): |
| 161 | +* [PR #226](https://github.com/rust-lang/regex/pull/226): |
67 | 162 | Implements NFA state compression in the lazy DFA.
|
68 |
| -* [PR #223](https://github.com/rust-lang-nursery/regex/pull/223): |
| 163 | +* [PR #223](https://github.com/rust-lang/regex/pull/223): |
69 | 164 | A fully anchored RegexSet can now short-circuit.
|
70 | 165 |
|
71 | 166 | 0.1.69
|
72 | 167 | ======
|
73 |
| -* [PR #216](https://github.com/rust-lang-nursery/regex/pull/216): |
| 168 | +* [PR #216](https://github.com/rust-lang/regex/pull/216): |
74 | 169 | Tweak the threshold for running backtracking.
|
75 |
| -* [PR #217](https://github.com/rust-lang-nursery/regex/pull/217): |
| 170 | +* [PR #217](https://github.com/rust-lang/regex/pull/217): |
76 | 171 | Add upper limit (from the DFA) to capture search (for the NFA).
|
77 |
| -* [PR #218](https://github.com/rust-lang-nursery/regex/pull/218): |
| 172 | +* [PR #218](https://github.com/rust-lang/regex/pull/218): |
78 | 173 | Add rure, a C API.
|
79 | 174 |
|
80 | 175 | 0.1.68
|
81 | 176 | ======
|
82 |
| -* [PR #210](https://github.com/rust-lang-nursery/regex/pull/210): |
| 177 | +* [PR #210](https://github.com/rust-lang/regex/pull/210): |
83 | 178 | Fixed a performance bug in `bytes::Regex::replace` where `extend` was used
|
84 | 179 | instead of `extend_from_slice`.
|
85 |
| -* [PR #211](https://github.com/rust-lang-nursery/regex/pull/211): |
| 180 | +* [PR #211](https://github.com/rust-lang/regex/pull/211): |
86 | 181 | Fixed a bug in the handling of word boundaries in the DFA.
|
87 |
| -* [PR #213](https://github.com/rust-lang-nursery/regex/pull/213): |
| 182 | +* [PR #213](https://github.com/rust-lang/pull/213): |
88 | 183 | Added RE2 and Tcl to the benchmark harness. Also added a CLI utility from
|
89 | 184 | running regexes using any of the following regex engines: PCRE1, PCRE2,
|
90 | 185 | Oniguruma, RE2, Tcl and of course Rust's own regexes.
|
91 | 186 |
|
92 | 187 | 0.1.67
|
93 | 188 | ======
|
94 |
| -* [PR #201](https://github.com/rust-lang-nursery/regex/pull/201): |
| 189 | +* [PR #201](https://github.com/rust-lang/regex/pull/201): |
95 | 190 | Fix undefined behavior in the `regex!` compiler plugin macro.
|
96 |
| -* [PR #205](https://github.com/rust-lang-nursery/regex/pull/205): |
| 191 | +* [PR #205](https://github.com/rust-lang/regex/pull/205): |
97 | 192 | More improvements to DFA performance. Competitive with RE2. See PR for
|
98 | 193 | benchmarks.
|
99 |
| -* [PR #209](https://github.com/rust-lang-nursery/regex/pull/209): |
| 194 | +* [PR #209](https://github.com/rust-lang/regex/pull/209): |
100 | 195 | Release 0.1.66 was semver incompatible since it required a newer version
|
101 | 196 | of Rust than previous releases. This PR fixes that. (And `0.1.66` was
|
102 | 197 | yanked.)
|
|
110 | 205 | complexity. It was replaced with a more limited optimization where, given any
|
111 | 206 | regex of the form `re$`, it will be matched in reverse from the end of the
|
112 | 207 | haystack.
|
113 |
| -* [PR #202](https://github.com/rust-lang-nursery/regex/pull/202): |
| 208 | +* [PR #202](https://github.com/rust-lang/regex/pull/202): |
114 | 209 | The inner loop of the DFA was heavily optimized to improve cache locality
|
115 | 210 | and reduce the overall number of instructions run on each iteration. This
|
116 | 211 | represents the first use of `unsafe` in `regex` (to elide bounds checks).
|
117 |
| -* [PR #200](https://github.com/rust-lang-nursery/regex/pull/200): |
| 212 | +* [PR #200](https://github.com/rust-lang/regex/pull/200): |
118 | 213 | Use of the `mempool` crate (which used thread local storage) was replaced
|
119 | 214 | with a faster version of a similar API in @Amanieu's `thread_local` crate.
|
120 | 215 | It should reduce contention when using a regex from multiple threads
|
|
124 | 219 | (Includes a comparison with PCRE1's JIT and Oniguruma.)
|
125 | 220 | * A bug where word boundaries weren't being matched correctly in the DFA was
|
126 | 221 | fixed. This only affected use of `bytes::Regex`.
|
127 |
| -* [#160](https://github.com/rust-lang-nursery/regex/issues/160): |
| 222 | +* [#160](https://github.com/rust-lang/regex/issues/160): |
128 | 223 | `Captures` now has a `Debug` impl.
|
0 commit comments