regex-automata
Automata construction and matching using regular expressions.
0.4.18
1.2B downloads/mo
#28 most downloaded on crates.io
rust-lang/regex
What this package is like to depend on
Last release 19 days ago
04 Aug 2026
Release timing varies
gaps range from 2 weeks to 10 months
Rarely documented
notes for 1 of 41 stable releases
1 version withdrawn
withdrawn after publishing
8 years old
42 releases · first in 2019
8 releases in the last 12 months
see the full history below
Release timeline
42 releases · Jan 2019 to Aug 2026Releases
latest 42-
0.4.1804 Aug 2026Nothing published for this version
-
0.4.1704 Aug 2026Nothing published for this version
-
0.4.1615 Jul 2026Nothing published for this version
-
0.4.1509 Jul 2026Nothing published for this version
-
0.4.1403 Feb 2026Nothing published for this version
-
0.4.1313 Oct 2025Nothing published for this version
-
0.4.1211 Oct 2025Nothing published for this version
-
0.4.1125 Sep 2025Nothing published for this version
-
0.4.1024 Aug 2025Nothing published for this version
-
0.4.911 Nov 2024Nothing published for this version
-
0.4.829 Sep 2024Nothing published for this version
-
0.4.709 Jun 2024Nothing published for this version
-
0.4.604 Mar 2024Nothing published for this version
-
0.4.525 Jan 2024Nothing published for this version
-
0.4.421 Jan 2024Nothing published for this version
-
0.4.316 Oct 2023Nothing published for this version
-
0.4.214 Oct 2023Nothing published for this version
-
0.4.109 Oct 2023Nothing published for this version
-
0.4.009 Oct 2023Nothing published for this version
-
0.3.930 Sep 2023Nothing published for this version
-
0.3.802 Sep 2023Nothing published for this version
-
0.3.726 Aug 2023Nothing published for this version
-
0.3.605 Aug 2023Nothing published for this version
-
0.3.505 Aug 2023Nothing published for this version
-
0.3.428 Jul 2023Nothing published for this version
-
0.3.312 Jul 2023Nothing published for this version
-
0.3.208 Jul 2023Nothing published for this version
-
0.3.107 Jul 2023Nothing published for this version
-
0.3.005 Jul 2023Nothing published for this version
-
0.2.010 Mar 2022Release notes
Open source →This is a new major release of the regex crate, and is an implementation of the regex 1.0 RFC. We are releasing a
0.2first, and if there are no major problems, we will release a1.0shortly. For0.2, the minimum supported Rust version is 1.12.There are a number of breaking changes in
0.2. They are split into two types. The first type correspond to breaking changes in regular expression syntax. The second type correspond to breaking changes in the API.Breaking changes for regex syntax:
- POSIX character classes now require double bracketing. Previously, the regex
[:upper:]would parse as theupperPOSIX character class. Now it parses as the character class containing the characters:upper:. The fix to this change is to use[[:upper:]]instead. Note that variants like[[:upper:][:blank:]]continue to work. - The character
[must always be escaped inside a character class. - The characters
&,-and~must be escaped if any one of them are repeated consecutively. For example,[&],[\&],[\&\&],[&-&]are all equivalent while[&&]is illegal. (The motivation for this and the prior change is to provide a backwards compatible path for adding character class set notation.) - A
bytes::Regexnow has Unicode mode enabled by default (like the mainRegextype). This means regexes compiled withbytes::Regex::newthat don't have the Unicode flag set should add(?-u)to recover the original behavior.
Breaking changes for the regex API:
findandfind_iternow returnMatchvalues instead of(usize, usize).Matchvalues havestartandendmethods, which return the match offsets.Matchvalues also have anas_strmethod, which returns the text of the match itself.- The
Capturestype now only provides a single iterator over all capturing matches, which should replace uses ofiteranditer_pos. Uses ofiter_namedshould use thecapture_namesmethod onRegex. - The
atmethod on theCapturestype has been renamed toget, and it now returns aMatch. Similarly, thenamemethod onCapturesnow returns aMatch. - The
replacemethods now returnCowvalues. TheCow::Borrowedvariant is returned when no replacements are made. - The
Replacertrait has been completely overhauled. This should only impact clients that implement this trait explicitly. Standard uses of thereplacemethods should continue to work unchanged. If you implement theReplacertrait, please consult the new documentation. - The
quotefree function has been renamed toescape. - The
Regex::with_size_limitmethod has been removed. It is replaced byRegexBuilder::size_limit. - The
RegexBuildertype has switched from ownedselfmethod receivers to&mut selfmethod receivers. Most uses will continue to work unchanged, but some code may require naming an intermediate variable to hold the builder. - The
compilemethod onRegexBuilderhas been renamed tobuild. - The free
is_matchfunction has been removed. It is replaced by compiling aRegexand calling itsis_matchmethod. - The
PartialEqandEqimpls onRegexhave been dropped. If you relied on these impls, the fix is to define a wrapper type aroundRegex, implDerefon it and provide the necessary impls. - The
is_emptymethod onCaptureshas been removed. This always returnsfalse, so its use is superfluous. - The
Syntaxvariant of theErrortype now contains a string instead of aregex_syntax::Error. If you were examining syntax errors more closely, you'll need to explicitly use theregex_syntaxcrate to re-parse the regex. - The
InvalidSetvariant of theErrortype has been removed since it is no longer used. - Most of the iterator types have been renamed to match conventions. If you
were using these iterator types explicitly, please consult the documentation
for its new name. For example,
RegexSplitshas been renamed toSplit.
A number of bugs have been fixed:
- BUG #151:
The
Replacertrait has been changed to permit the caller to control allocation. - BUG #165:
Remove the free
is_matchfunction. - BUG #166:
Expose more knobs (available in
0.1) and removewith_size_limit. - BUG #168:
Iterators produced by
Capturesnow have the correct lifetime parameters. - BUG #175: Fix a corner case in the parsing of POSIX character classes.
- BUG #178:
Drop the
PartialEqandEqimpls onRegex. - BUG #179:
Remove
is_emptyfromCapturessince it always returns false. - BUG #276:
Position of named capture can now be retrieved from a
Captures. - BUG #296: Remove winapi/kernel32-sys dependency on UNIX.
- BUG #307: Fix error on emscripten.
- POSIX character classes now require double bracketing. Previously, the regex
-
0.1.1001 Jun 2021Nothing published for this version
-
0.1.909 Mar 2020Nothing published for this version
-
0.1.821 Jul 2019Nothing published for this version
-
0.1.709 Jun 2019Nothing published for this version
-
0.1.625 Feb 2019Nothing published for this version
-
0.1.510 Jan 2019Nothing published for this version
-
0.1.410 Jan 2019 withdrawnNothing published for this version
-
0.1.306 Jan 2019Nothing published for this version
-
0.1.204 Jan 2019Nothing published for this version
-
0.1.104 Jan 2019Nothing published for this version
-
0.1.004 Jan 2019Nothing published for this version
-
0.0.102 Jan 2019Nothing published for this version