Debian Codegraph @

debian/rust-vendor/fancy-regex/CHANGELOG.md

raw
1 # Changelog
2
3 All notable changes to this project will be documented in this file.
4
5 The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
6 This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html),
7 with the exception that 0.x versions can break between minor versions.
8
9 ## [Unreleased]
10 ### Added
11 ### Changed
12 ### Fixed
13
14 ## [0.19.2] - 2026-09-13
15 ### Added
16 - Add a `leftmost_longest` feature (off by default) that adds a method to the `RegexBuilder`/`RegexOptionsBuilder` for building a VM which would operate in leftmost-longest match mode instead of the regular leftmost-first mode. Useful for POSIX compliance. (#281)
17 ### Changed
18 ### Fixed
19
20 ## [0.19.1] - 2026-09-06
21 ### Added
22 - Add a `perf-dfa-full` feature (off by default, mirroring the `regex` crate) that lets regex-automata eagerly build fully compiled dense DFAs for small patterns, for workloads that compile few regexes and match them very heavily (#272)
23 ### Changed
24 - Add VM instruction for case insensitive literals when in Unicode mode, to keep the build cost bounded (#268) and ensured the toy example graph output remains readable instead of being super verbose (#269)
25 - Compilation performance: the `regex-automata` dependency no longer enables the `dfa-build` feature by default. With `dfa-build` enabled, `meta::Regex` eagerly determinizes a full dense DFA for every small pattern, which dominated build time of simple class-containing patterns (e.g. `\b(extern)\s+(crate)` compiled ~4x slower than with the `regex` crate, which also ships without `dfa-build`); searches use the lazy DFA instead, with no measurable match-time difference (#272)
26 - Compilation performance: identical delegated fragments within one compile now share a single regex-automata engine instead of each building their own. Alternation-heavy patterns (TextMate grammar lookbehinds especially) often repeat the same fragment many times; on such patterns this removes a large share of build time (#277)
27 ### Fixed
28 - The playground didn't show when a literal or backreference was being matched case insensitively in the analysis tree view (#269)
29 - Seek patterns could become very large when recursive backrefs and subroutine calls were inlined, without bringing much benefit (#270)
30 - The `optimize_nested_repeats` pass could rewrite an optional capture group like `(\w+)?` into `(\w*)`, causing an unmatched optional group to be reported as an empty match (`Some("")`) instead of `None` (#276)
31
32 ## [0.19.0] - 2026-07-28
33 ### Added
34 - Add `BytesMode` and the `RegexInput` trait so the matching and capture APIs can operate on strings or bytes, and allows to opt out of unicode handling if desired (#248)
35 - Also allows searching within a range without slicing (#253)
36 - Assertions can be overridden at runtime, if the regex builder `allow_input_assertion_overrides` option was used (#254)
37 - Search can be performed in anchored mode, searching only at the start position specified (#263)
38 - Add experimental seek optimization to only invoke the VM at candidate positions where a match could occur (#246)
39 - Add `RegexBuilder::disallow_empty_match_at_eof_after_newline` to reject empty matches at the end of the haystack following a trailing newline, to match Oniguruma behavior (#247)
40 - Add `RegexSet` API for efficiently matching multiple patterns against the same text (#255)
41 ### Changed
42 - Case-insensitive backreference comparison of non-ASCII text now uses direct Unicode simple case folding instead of building a regex engine per comparison, which makes patterns like `(?i)(\w+)\1` orders of magnitude faster on non-ASCII haystacks. The comparison is now strict fold equality over the captured text's byte-length window: a case-folded *prefix* of the window no longer counts as a match (previously a substring search could accept one and misalign the match end)
43 - Compilation performance: delegated regex-automata engines (including the whole pattern in the easy case) are now built from a directly-constructed `Hir` instead of a re-serialized pattern string, and `RegexSet` parses each pattern once for both of its set-wide engines instead of three times. This reduces compile time and peak compile memory, especially for `RegexSet` and small easy patterns
44 - Match performance: the backtracking VM's working memory (saves, backtrack stack, delegate slots) is pooled and reused across runs, making `is_match`/`find`/`find_iter` and `RegexSet` candidate verification allocation-free per call; `RegexSet::find_input` no longer allocates at failed candidate positions. Short and repeated matches improve substantially (up to ~30% for small patterns, ~10% for `find_iter` over many matches); single very long backtracking runs, where per-run setup is fully amortized anyway, can be a few percent slower
45 - `Matches`, `CaptureMatches`, `Captures`, and `SubCaptureMatches` are now generic over `RegexInput`, which is a breaking change for code that named these types explicitly (#248)
46 - Patterns no longer force Unicode mode during parsing, and inline `(?u)` / `(?-u)` flags are accepted when they agree with the builder configuration
47 ### Fixed
48 - Fix bug whereby inline flags were not overriding the builder options (#247)
49 - Fix bug whereby `\G` optimizations were applying where they shouldn't, giving wrong results (#256)
50 - Support Oniguruma quantifier parsing rules, whereby swapped ordering causes possessiveness, `+` only causes possessiveness after `?`, `*` or `+` (#258)
51 ### Upgrade guide
52 If you previously stored i.e. `Captures`, you would need to change the type to `Captures<str>` to get the code to compile.
53
54 ## [0.18.0] - 2026-04-24
55 ### Added
56 - Add support for `\N` to mean any character except newline, for Oniguruma compatibility (#206)
57 - Add support for `(*FAIL)` backtracking control verb (#210)
58 - Add support for more `\p{...}` and `\P{...}` aliases, for Oniguruma compatibility (#207)
59 - Add support for word boundaries and zero-length fancy patterns inside variable lookbehinds (at top level) (#216)
60 - Add support for `\R` to mean general newline, matching all common line break characters, treating `\r\n` atomically (#220)
61 - Add support for the regex crate's `(?R)` CRLF mode flag (#238)
62 - Add support for subroutine calls (including recursion up to 20 levels deep, matching Oniguruma behavior) `\g<1>` (#230)
63 - Add support for Oniguruma's absent repeater `(?~abc)` (#233)
64 - Add support for ignoring empty matches (#240)
65 - Add support for treating unnamed capture groups as non-capturing when named groups exist (#241)
66 ### Changed
67 - `RegexBuilder` can now build multiple patterns with the same options (#213)
68 - Parsing of capture group names is now more lenient (#241)
69 ### Fixed
70 - Fixed bug with parsing nested character classes containing unescaped `]` (#211)
71
72 ## [0.17.0] - 2025-12-13
73 ### Added
74 - Add support for "easy" variable-length lookbehinds (enabled via new feature flag) (#194, #196)
75 - Add support for more word boundaries: `\b{start}`, `\b{end}`, `\b{start-half}`, `\b{end-half}` (#193)
76 - Allow `{...}` repetition syntax after assertions (except in Oniguruma mode) (#193)
77 - Add Oniguruma mode flag to playground (#199)
78 ### Changed
79 - Rewrite Theory section of Readme in a more formal style (#187)
80 - Box `CompileError` in `Error` enum to reduce size (#204)
81 - Bail out early when `\G` fails to match for increased performance (#198)
82 - Handle `ignore_whitespace` case in parsing escape sequences (#193)
83 - Add tests to ensure that `Regex` is `Send` and `Sync` (#195)
84 ### Fixed
85 - Fix clippy lint warnings (#204)
86
87 ## [0.16.2] - 2025-09-19
88 ### Added
89 - Add an "oniguruma mode" flag to control whether `\<` and `\>` are treated as literals or word-boundary assertions. (#186)
90 - Add support for const-size backrefs in lookbehinds. (#182)
91 ### Changed
92 - A few small internal changes which allowed us to expose a web-based playground for fancy-regex. (#181)
93 ### Fixed
94 - Fix behavior of repetition on an empty match. (#179)
95 - Always return the original input pattern when `as_str` is called. (#185)
96 - Fix panic when matching non-ascii text as part of a case insensitive backref. (#189)
97 - The `toy` example wasn't always showing the correct analysis or compiled program when optimizations were applied. (#181)
98
99 ## [0.16.1] - 2025-08-02
100 ### Fixed
101 - Fixed a bug whereby sometimes a backreference to a non-existing capture group would compile successfully
102 when it should fail, causing a panic in the VM when trying to match the regex. (#174)
103
104 ## [0.16.0] - 2025-08-01
105 ### Added
106 - Add an optimization step after the pattern is parsed but before it is analyzed.
107 Currently it only optimizes one specific use-case - where the expression is easy except
108 for a trailing positive lookahead whose contents are also easy. The optimization is to delegate to the regex crate instead of using the backtracking VM. (#171)
109 ### Changed
110 - Patterns which are anchored to the start of the text (i.e. with `^` when not in multiline mode) should now fail faster when there is no match, because `fancy-regex` no longer tries to match at other positions. (#170)
111 - The `CompileError` for an invalid (numbered) backref has been updated to mention which backref was invalid (#170)
112 - Removed dependency on derivative (#169)
113 ### Fixed
114 - Fixed a bug whereby sometimes a capture group containing a backref to itself would cause a compile error, when it is valid - this fixes a few Oniguruma test cases (#170)
115
116 ## [0.15.0] - 2025-07-06
117 ### Added
118 - Support `\Z` - anchor to the end of the text before any trailing newlines. (#148)
119 - Support `\O` - any character including newlines. (#158)
120 - The parser can now parse subroutine calls and relative backreferences (but execution is still unsupported). This is preparation for future work. Some new error variants have been added for features which can be parsed but are still otherwise unsupported.
121 - Backreferences can now be case insensitive. (#160)
122 - `RegexBuilder`: Add options for `multi_line`, `ignore_whitespace`, `dot_matches_new_line` (#165)
123 ### Fixed
124 - Fix infinite loop when backtracking limit is hit (#153)
125 - Fix `RegexBuilder.case_insensitive` not always applying when it should. (#163)
126 - The `toy` example has had various bugfixes, and unit tests added. (#152, #159)
127
128 ## [0.14.0] - 2024-10-24
129 ### Added
130 - Add `split`, `splitn` methods to `Regex` to split a string into substrings (#140)
131 - Add `case_insensitive` method to `RegexBuilder` to force case-insensitive mode (#132)
132 ### Changed
133 - Bump bit-set dependency to 0.8 (#139)
134
135 ## [0.13.0] - 2023-12-22
136 ### Added
137 - Support for relative backreferences using `\k<-1>` (-1 references the
138 previous group) (#121)
139 - Add `try_replacen` to `Regex` which returns a `Result` instead of panicking
140 when matching errors (#130)
141 ### Changed
142 - Switch from regex crate to regex-automata and regex-syntax (lower level APIs)
143 to simplify internals (#121)
144 - **Note:** Due to above change, more backtracking is done in fancy-regex itself
145 instead of regex-automata, and you might get a `BacktrackLimitExceeded` with
146 some patterns that you didn't get before. You can increase the backtrack limit
147 using `RegexBuilder::backtrack_limit` to help with that.
148 - Allow escaping some letters in character classes, e.g. `[\A]` used to error
149 but now matches the same as `[A]` (for compatibility with Oniguruma)
150 - MSRV (minimum supported Rust version) is now 1.66.1 (from 1.61.0)
151 ### Fixed
152 - Fix index out of bounds panic when parsing unclosed `(?(` (#125)
153
154 ## [0.12.0] - 2023-11-11
155 ### Added
156 - Support for `no_std` (the `std` feature is enabled by default but can be
157 disabled if desired) (#111)
158 - `TryFrom` `&str` and `String` impl for `Regex` (#115)
159 ### Changed
160 - `Error` and its components are now `Clone` (#116)
161 - MSRV (minimum supported Rust version) is now 1.61.0 (from 1.42.0)
162
163 ## [0.11.0] - 2023-01-12
164 ### Added
165 - Support for [conditionals](https://www.regular-expressions.info/conditional.html): using a regex like
166 `(?<test>a)?b(?(test)c|d)` will try to match `c` after `b` if `a` matched in the capture group named
167 `test`, otherwise `d` after `b` if `a` wasn't captured into the `test` group.
168 ### Changed
169 - Updated parse errors to show the position they occurred at.
170 ### Fixed
171 - Fix panic when backref is used within referenced group itself and
172 group end index is not known yet (#103)
173
174 ## [0.10.0] - 2022-04-28
175 ### Added
176 - Support for `\G` ([anchor to end of previous match](https://www.regular-expressions.info/continue.html)): Using a regex
177 like `\G\w` will match each letter of `foo` in `foo bar` but
178 nothing else.
179
180 ## [0.9.0] - 2022-04-21
181 ### Added
182 - Support for `\K` ([keep out](https://www.regular-expressions.info/keep.html)): Using a regex like `@\K\w+` will match
183 things like `@foo` but the resulting match text will only include
184 `foo`, keeping out the `@`.
185
186 ## [0.8.0] - 2022-02-22
187 ### Added
188 - Allow users to disable any of the `unicode` and `perf-*` features of
189 the regex crate. Disabling these features can reduce compile time
190 and/or binary size for use cases where these features are not needed.
191 (All features remain enabled by default.)
192 ### Changed
193 - MSRV (minimum supported Rust version) is now 1.42.0 (from 1.41.1)
194
195 ## [0.7.1] - 2021-07-29
196 ### Fixed
197 - Fix panic on incomplete escape sequences in input regexes
198 - Disallow quantifers on lookarounds and other zero-width assertion
199 expressions, e.g. the `+` in `(?=hello)+`
200
201 ## [0.7.0] - 2021-07-12
202 ### Added
203 - `Regex` now has replace methods like the regex crate:
204 - `replace` - single replacement
205 - `replace_all` - replace all non-overlapping matches
206 - `replacen` - configurable number of replacements
207
208 ## [0.6.0] - 2021-05-17
209 ### Added
210 - `Regex` now implements `Clone`, `Display`, `FromStr`
211 - `Captures` now implements `Index<usize>` to access captures by number
212 and `Index<&str>` to access by name
213
214 ## [0.5.0] - 2021-02-15
215 ### Added
216 - Methods `find_iter` and `captures_iter` to iterate over all
217 non-overlapping matches for a string
218 - Method `find_from_pos` to `find` starting from a specific position
219 ### Changed
220 - MSRV (minimum supported Rust version) is now 1.41.1 (from 1.32.0)
221
222 ## [0.4.1] - 2020-11-09
223 ### Added
224 - `escape` function to escape special characters in a string so that it
225 matches literally
226
227 ## [0.4.0] - 2020-09-27
228 ### Added
229 - Support for named groups and backrefs:
230 - Capture with `(?<name>...)` or `(?P<name>...)`
231 - Backref with `\k<name>` or `(?P=name)`
232 - `Captures::name` to get matched group by name
233 - `Regex::capture_names` to get capture names in regex
234 - Support for expanding matches using a replacement template string
235 - `Captures::expand` for regex crate compatible syntax
236 - See `Expander` for python-compatible syntax and advanced usage
237 - `Match::range` and some `From` impls for convenience
238
239 ## [0.3.5] - 2020-04-28
240 ### Changed
241 - Include string snippet in errors for unknown group and invalid escape
242 to make it easier to identify the problem.
243
244 ## [0.3.4] - 2020-04-28
245 ### Added
246 - Support comments using `(?# comment)` syntax
247 - Support unicode escapes like `\u21D2` and `\U0001F60A`
248
249 ## [0.3.3] - 2020-02-28
250 ### Changed
251 - Optimization: Delegate const-sized suffixes in more cases
252 - Optimization: Use `captures_read_at` when delegating to regex crate
253
254 ## [0.3.2] - 2020-02-05
255 ### Fixed
256 - Some regexes with fancy parts in the beginning/middle didn't match
257 when they should have, e.g. `((?!x)(a|ab))c` didn't match `abc`.
258
259 ## [0.3.1] - 2019-12-09
260 ### Added
261 - Add `delegate_size_limit` and `delegate_dfa_size_limit` to
262 `RegexBuilder` to allow configuring these limits for regex crate.
263
264 ## [0.3.0] - 2019-11-27
265 ### Added
266 - Add limit for backtracking so that execution errors instead of running
267 for a long time in case of catastrophic backtracking.
268 - Add `RegexBuilder` with `backtrack_limit` to configure the new
269 backtrack limit per regex.
270 - `Error` now implements `std::error::Error` trait
271 ### Fixed
272 - Fix panic in backref matching with multibyte chars
273
274 ## [0.2.0] - 2019-10-19
275 ### Added
276 - More documentation and examples
277 - Support character class nesting and intersections (implemented in
278 regex crate)
279 - Support atomic groups, both the the `(?>foo)` group syntax and the
280 `a++`, `a*+` and `a?+` possessive syntax
281 - Support `\b`, `\f`, `\t`, `\n`, `\r`, `\v`
282 - Support look-behind with variable sized alternative
283 - Implement `Debug` for `Regex`
284 - More test coverage including running one of Oniguruma's test suites
285 ### Changed
286 - Change `find` to return a `Match` struct (breaking change)
287 - Change `Captures` API (breaking change):
288 - Replace `at` and `pos` with `get` that returns a `Match` struct
289 - Remove `is_empty` (use `len`)
290 - Allow unescaped `]` and `}` as literals
291 - Allow unescaped `{` as literal when not after atom
292 - Allow escapes such as `\<` or `\e` inside character classes
293 - Allow up to 8 characters in `\x{...}` escape
294 - Allow escaping of space to make literal space
295 - Allow `(a|)`
296 - Reject invalid backreferences
297 ### Fixed
298 - Multiple fixes for alternatives in look-arounds
299 - Fix hex escape to not include letters after "F"
300 - Fix handling of unescaped `]` in character classes
301 - Fix case insensitive character classes and other escapes
302 - Don't ignore spaces in character classes even with "comment mode"
303
304 ## [0.1.0] - 2017-02-06
305 ### Added
306 - Initial release
307
308 [Unreleased]: https://github.com/fancy-regex/fancy-regex/compare/0.19.2...HEAD
309 [0.19.1]: https://github.com/fancy-regex/fancy-regex/compare/0.19.1...0.19.2
310 [0.19.1]: https://github.com/fancy-regex/fancy-regex/compare/0.19.0...0.19.1
311 [0.19.0]: https://github.com/fancy-regex/fancy-regex/compare/0.18.0...0.19.0
312 [0.18.0]: https://github.com/fancy-regex/fancy-regex/compare/0.17.0...0.18.0
313 [0.17.0]: https://github.com/fancy-regex/fancy-regex/compare/0.16.2...0.17.0
314 [0.16.2]: https://github.com/fancy-regex/fancy-regex/compare/0.16.1...0.16.2
315 [0.16.1]: https://github.com/fancy-regex/fancy-regex/compare/0.16.0...0.16.1
316 [0.16.0]: https://github.com/fancy-regex/fancy-regex/compare/0.15.0...0.16.0
317 [0.15.0]: https://github.com/fancy-regex/fancy-regex/compare/0.14.0...0.15.0
318 [0.14.0]: https://github.com/fancy-regex/fancy-regex/compare/0.13.0...0.14.0
319 [0.13.0]: https://github.com/fancy-regex/fancy-regex/compare/0.12.0...0.13.0
320 [0.12.0]: https://github.com/fancy-regex/fancy-regex/compare/0.11.0...0.12.0
321 [0.11.0]: https://github.com/fancy-regex/fancy-regex/compare/0.10.0...0.11.0
322 [0.10.0]: https://github.com/fancy-regex/fancy-regex/compare/0.9.0...0.10.0
323 [0.9.0]: https://github.com/fancy-regex/fancy-regex/compare/0.8.0...0.9.0
324 [0.8.0]: https://github.com/fancy-regex/fancy-regex/compare/0.7.1...0.8.0
325 [0.7.1]: https://github.com/fancy-regex/fancy-regex/compare/0.7.0...0.7.1
326 [0.7.0]: https://github.com/fancy-regex/fancy-regex/compare/0.6.0...0.7.0
327 [0.6.0]: https://github.com/fancy-regex/fancy-regex/compare/0.5.0...0.6.0
328 [0.5.0]: https://github.com/fancy-regex/fancy-regex/compare/0.4.1...0.5.0
329 [0.4.1]: https://github.com/fancy-regex/fancy-regex/compare/0.4.0...0.4.1
330 [0.4.0]: https://github.com/fancy-regex/fancy-regex/compare/0.3.5...0.4.0
331 [0.3.5]: https://github.com/fancy-regex/fancy-regex/compare/0.3.4...0.3.5
332 [0.3.4]: https://github.com/fancy-regex/fancy-regex/compare/0.3.3...0.3.4
333 [0.3.3]: https://github.com/fancy-regex/fancy-regex/compare/0.3.2...0.3.3
334 [0.3.2]: https://github.com/fancy-regex/fancy-regex/compare/0.3.1...0.3.2
335 [0.3.1]: https://github.com/fancy-regex/fancy-regex/compare/0.3.0...0.3.1
336 [0.3.0]: https://github.com/fancy-regex/fancy-regex/compare/0.2.0...0.3.0
337 [0.2.0]: https://github.com/fancy-regex/fancy-regex/compare/0.1.0...0.2.0
338 [0.1.0]: https://github.com/fancy-regex/fancy-regex/commits/0.1.0