All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog. This project adheres to Semantic Versioning, with the exception that 0.x versions can break between minor versions.
0.14.0 - 2024-10-24
- Add
split
,splitn
methods toRegex
to split a string into substrings (#140) - Add
case_insensitive
method toRegexBuilder
to force case-insensitive mode (#132)
- Bump bit-set dependency to 0.8 (#139)
0.13.0 - 2023-12-22
- Support for relative backreferences using
\k<-1>
(-1 references the previous group) (#121) - Add
try_replacen
toRegex
which returns aResult
instead of panicking when matching errors (#130)
- Switch from regex crate to regex-automata and regex-syntax (lower level APIs) to simplify internals (#121)
- Note: Due to above change, more backtracking is done in fancy-regex itself
instead of regex-automata, and you might get a
BacktrackLimitExceeded
with some patterns that you didn't get before. You can increase the backtrack limit usingRegexBuilder::backtrack_limit
to help with that. - Allow escaping some letters in character classes, e.g.
[\A]
used to error but now matches the same as[A]
(for compatibility with Oniguruma) - MSRV (minimum supported Rust version) is now 1.66.1 (from 1.61.0)
- Fix index out of bounds panic when parsing unclosed
(?(
(#125)
0.12.0 - 2023-11-11
- Support for
no_std
(thestd
feature is enabled by default but can be disabled if desired) (#111) TryFrom
&str
andString
impl forRegex
(#115)
Error
and its components are nowClone
(#116)- MSRV (minimum supported Rust version) is now 1.61.0 (from 1.42.0)
0.11.0 - 2023-01-12
- Support for conditionals: using a regex like
(?<test>a)?b(?(test)c|d)
will try to matchc
afterb
ifa
matched in the capture group namedtest
, otherwised
afterb
ifa
wasn't captured into thetest
group.
- Updated parse errors to show the position they occurred at.
- Fix panic when backref is used within referenced group itself and group end index is not known yet (#103)
0.10.0 - 2022-04-28
- Support for
\G
(anchor to end of previous match): Using a regex like\G\w
will match each letter offoo
infoo bar
but nothing else.
0.9.0 - 2022-04-21
- Support for
\K
(keep out): Using a regex like@\K\w+
will match things like@foo
but the resulting match text will only includefoo
, keeping out the@
.
0.8.0 - 2022-02-22
- Allow users to disable any of the
unicode
andperf-*
features of the regex crate. Disabling these features can reduce compile time and/or binary size for use cases where these features are not needed. (All features remain enabled by default.)
- MSRV (minimum supported Rust version) is now 1.42.0 (from 1.41.1)
0.7.1 - 2021-07-29
- Fix panic on incomplete escape sequences in input regexes
- Disallow quantifers on lookarounds and other zero-width assertion
expressions, e.g. the
+
in(?=hello)+
0.7.0 - 2021-07-12
Regex
now has replace methods like the regex crate:replace
- single replacementreplace_all
- replace all non-overlapping matchesreplacen
- configurable number of replacements
0.6.0 - 2021-05-17
Regex
now implementsClone
,Display
,FromStr
Captures
now implementsIndex<usize>
to access captures by number andIndex<&str>
to access by name
0.5.0 - 2021-02-15
- Methods
find_iter
andcaptures_iter
to iterate over all non-overlapping matches for a string - Method
find_from_pos
tofind
starting from a specific position
- MSRV (minimum supported Rust version) is now 1.41.1 (from 1.32.0)
0.4.1 - 2020-11-09
escape
function to escape special characters in a string so that it matches literally
0.4.0 - 2020-09-27
- Support for named groups and backrefs:
- Capture with
(?<name>...)
or(?P<name>...)
- Backref with
\k<name>
or(?P=name)
Captures::name
to get matched group by nameRegex::capture_names
to get capture names in regex
- Capture with
- Support for expanding matches using a replacement template string
Captures::expand
for regex crate compatible syntax- See
Expander
for python-compatible syntax and advanced usage
Match::range
and someFrom
impls for convenience
0.3.5 - 2020-04-28
- Include string snippet in errors for unknown group and invalid escape to make it easier to identify the problem.
0.3.4 - 2020-04-28
- Support comments using
(?# comment)
syntax - Support unicode escapes like
\u21D2
and\U0001F60A
0.3.3 - 2020-02-28
- Optimization: Delegate const-sized suffixes in more cases
- Optimization: Use
captures_read_at
when delegating to regex crate
0.3.2 - 2020-02-05
- Some regexes with fancy parts in the beginning/middle didn't match
when they should have, e.g.
((?!x)(a|ab))c
didn't matchabc
.
0.3.1 - 2019-12-09
- Add
delegate_size_limit
anddelegate_dfa_size_limit
toRegexBuilder
to allow configuring these limits for regex crate.
0.3.0 - 2019-11-27
- Add limit for backtracking so that execution errors instead of running for a long time in case of catastrophic backtracking.
- Add
RegexBuilder
withbacktrack_limit
to configure the new backtrack limit per regex. Error
now implementsstd::error::Error
trait
- Fix panic in backref matching with multibyte chars
0.2.0 - 2019-10-19
- More documentation and examples
- Support character class nesting and intersections (implemented in regex crate)
- Support atomic groups, both the the
(?>foo)
group syntax and thea++
,a*+
anda?+
possessive syntax - Support
\b
,\f
,\t
,\n
,\r
,\v
- Support look-behind with variable sized alternative
- Implement
Debug
forRegex
- More test coverage including running one of Oniguruma's test suites
- Change
find
to return aMatch
struct (breaking change) - Change
Captures
API (breaking change):- Replace
at
andpos
withget
that returns aMatch
struct - Remove
is_empty
(uselen
)
- Replace
- Allow unescaped
]
and}
as literals - Allow unescaped
{
as literal when not after atom - Allow escapes such as
\<
or\e
inside character classes - Allow up to 8 characters in
\x{...}
escape - Allow escaping of space to make literal space
- Allow
(a|)
- Reject invalid backreferences
- Multiple fixes for alternatives in look-arounds
- Fix hex escape to not include letters after "F"
- Fix handling of unescaped
]
in character classes - Fix case insensitive character classes and other escapes
- Don't ignore spaces in character classes even with "comment mode"
0.1.0 - 2017-02-06
- Initial release