NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI
PyPI, #1054 most downloaded on PyPI
A wrapper around re and regex that adds additional back references.
Latest stable
8.2
Last release 19 days ago
03 Nov 2026
Release timing varies
gaps range from 3 weeks to 10 months
Nearly every release is documented
notes for 53 of 55 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
63 releases · first in 2016
Drag across the ruler to compare, or tap a release to open it.
FIX: Fix error in replace templates when casing a character escape gives two characters (\C\xdf\E).
\C\xdf\E).\x escape exceeds the byte range in replace templates.{1:}) raising an error in format replace templates.\p{L} and \p{Bidi_Class=L}, not matching ideographs,
Hangul syllables, and other characters Unicode defines as ranges.\g<...> references in replace templates silently dropping invalid characters in a group name
instead of raising an error.\p{...} Unicode properties rejecting the canonical dotted value form (e.g. Age=1.1),
which previously only worked through the alias form (e.g. V1_1).[x[:property:]]) were incorrectly
detected with [x[l]] (@rahul05ranjan).\N{...} raising a KeyError instead of PatternError
(@rahul05ranjan).NEW: Add official support for Python 3.15.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
NEW: Backrefs will preemptively fail, raising a PatternError, if parsing and finding an unterminated character set ([]) or an unterminated subpattern
PatternError, if parsing and finding an unterminated character
set ([]) or an unterminated subpattern (()). Both re and regex already do this (re just issues a warning
on Python 3.10), but backrefs will now terminate parsing early instead of waiting for the underlying regular
expression parsers to catch it after the fact. This will occur even on Python 3.10. If Python 3.10 behavior is
required, please use Backrefs 7.0 until migration is possible.PatternError in bre if global flag syntax is not used at the start of the
pattern. Python re already does this, except on Python 3.10 where a warning is raised. Backrefs will now do this
in bre, even on Python 3.10, to prevent backtracking in Backrefs' parser when global flags are redefined. If the
old behavior is required, please use 7.0 until migration is possible.PatternError in bregex if a global flag is not used at the start of the
pattern. This does not affect inline flags that use the global syntax (e.g. (?i)) as regex allows this to be
scoped to subpatterns ((...)) and affects the pattern after its insertion whether in a subpattern or outside a
subpattern. While regex doesn't specifically restrict global flag insertion, only the last instance takes effect,
Backrefs requires these global flags to be declared at the beginning of the pattern to prevent backtracking when
parsing the pattern. If the old behavior is required, please use 7.0 until migration is possible.ValueError and SyntaxError that used to be raised by the bre or bregex parser are now
raised as backrefs.util.PatternError.bregex related to regex handling of inline flags using global syntax.BREAK: Remove deprecated \e and \h support.
\e and \h support.non_joining, but should have been
no_joining_group.NEW Add alias prefixmatch for match in both bre and bregex.
prefixmatch for match in both bre and bregex.NEW: Include Unicode 17 zip for early Python 3.15 usage, though Python 3.15 functionality is not guaranteed.
FIX: Fix a regression that created an ASCII binary property that would override the ASCII block property.
NEW: POSIX character classes will now always use POSIX compatibility rules instead of Unicode standard rules, if any are specified in the Unicode spec
[[:alnum:]], [[:digit:]],
[[:xdigit:]], and [[:punct:]]. To explicitly use standard Unicode rules for these compatibility properties, use
the Unicode property form instead: [\p{Alnum}], [\p{Digit}], [\p{Punct}], or [\p{XDigit}]. This has changed
to ensure no confusion for users expecting compatible POSIX style character class properties.(?a:pattern)/(?u:pattern)) should be respected for Unicode properties in
bre and will ensure ASCII or Unicode range if used.NEW: Add support for Python 3.14.
## 5.8 - NEW: Drop Python 3.8. - FIX: Deprecation warnings.
Nothing published for this version
FIX: Update project metadata to indicate Python 3.12 support.
NEW: Officially support Python 3.12.
FIX: Fix some flag issues in bregex.
bregex.NEW: \e and \h have both been deprecated in 6.0. Please migrate to using \x1b and \p{Horiz_Space} in their respective place.
\e and \h have both been deprecated in 6.0. Please migrate to using \x1b and \p{Horiz_Space} in
their respective place.sub functions.NEW: Officially support Python 3.11.
\p{Vert_Space} and \p{Horiz_Space} that match Regex's new
custom properties. This helps to expose vertical space shorthand that was not previously present.NEW: Update build backend to use Hatch.
FIX: Re format replacement captures behave more like Regex in that you can technically index into the captures of a given group in Re, but in Re there
None. This caused a bug in some cases where you'd have None inserted for a group if a group was optional, but
referenced in the replacement template. Now the implementation matches the description in the documentation with the
documentation now being more explicit about behavior.mrabarnett/mrab-regex#439) as well as in
Backrefs.NEW: Add support for Python 3.10.
## 5.0.1 - FIX: Fix wheel names.
NEW: Removed the old deprecated search references: \l, \L, \c, and \C. These are available in various other forms: [[]], \p{lower}, etc.
ASCII flag and will properly restrict the range of properties to the ASCII range even in Unicode strings.\l, \L, \c, and \C. These are available in various other forms: [[:lower:]], \p{lower}, etc.NEW: Provide wheels for all officially supported versions of Python.
NEW: Added new back reference \h to Re. To get similar functionality with Regex, users must update to the latest Regex release.
\h to Re. To get similar functionality with Regex, users must update to the latest Regex release.Added the following binary properties for Unicode 13.0 support (Python 3.9): emoji, emojicomponent, emojimodifier, emojimodifierbase, and emojipresent
emoji, emojicomponent,
emojimodifier, emojimodifierbase, and emojipresentation. Associated aliases are also included: ecomp, emod,
ebase, and epres.NEW: Remove version and __version__ and remove associated deprecation code.
pip install backrefs[extras].version and __version__ and remove associated deprecation code.FIX: Fix Python 3.8 installation issue due to Unicode bundle having an incorrect encoding in some files.
NEW: Deprecate the search references \l, \L, \c, and \C. The POSIX alternatives (which these were shortcuts for) should be used instead: [[]], [[:^low…
\l, \L, \c, and \C. The POSIX alternatives (which these were shortcuts for) should be used instead: [[:lower:]], [[:^lower:]], [:upper:]], and [[:^upper:]] respectively.FIX: Later pre-release versions of Python 3.8 will support Unicode 12.1.0.
NEW: Add official support for Python 3.8.
Pep562 library instead of requiring as a dependency.*args and **kwargs instead of specify every parameter in order to allow Backrefs to work even when the Re or Regex API changes. Change was made to support new Regex timeout parameter.FIX: Fix compatibility issues with latest Regex versions.
FIX: Ensure that when generating the Unicode property tables, that the property files are read in with UTF-8 encoding.
UTF-8 encoding.NEW: Drop support for new features in Python 2. Python 2 support is limited to the 3.X.X series and will only receive bug fixes up to 2020. All new fe
…and add the __version_info__ attribute as well. Deprecate the old version and version_info attribute for future removal.
__version__ attribute and add the __version_info__ attribute as well. Deprecate the old version and version_info attribute for future removal.FIX: Include zip for Unicode 11 (Python 3.7) to make installation more reliable.
FIX: POSIX character classes should not be part of a range.
Jun 3, 2018
\L, \C, and \E should all terminate \L, and \C. \l and \c will be ignored if followed by \C or \L.NEW: Use a more advanced format string implementation that implements all string features, included those found in format_spec.
Mar 13, 2018
format_spec.NEW: Add support for generic line breaks (\R) to Re.
Mar 8, 2018
\R) to Re.\X) to Re. Roughly equivalent to (?>\PM\pM*).Vertical_Orientation property for Unicode 10.0.0 on Python 3.7.NEW: Add support for Indic_Positional_Category\\Indic_Matra_Category and Indic_Syllabic_Category properties.
Feb 27, 2018
Indic_Positional_Category\Indic_Matra_Category and Indic_Syllabic_Category properties.FIX: Bidi_Paired_Bracket_type property's None value should be equivalent to all characters that are not open or close characters.
Feb 26, 2018
Bidi_Paired_Bracket_type property's None value should be equivalent to all characters that are not open or close characters.NEW: Add support for Script_Extensions Unicode properties (Python 3 only as Python 2, Unicode 5.2.0 does not define these). Can be accessed via \p{scr
Feb 25, 2018
Script_Extensions Unicode properties (Python 3 only as Python 2, Unicode 5.2.0 does not define these). Can be accessed via \p{scripts_extensions: kana} or \p{scx: kana}.\p{Kana}, use Script_Extensions instead of Scripts. To get Scripts results, you must specify \p{scripts: kana} or \p{sc: scripts}.Bidi_Paired_Bracket_Type Unicode property (Python 3.4+ only).IsBinary for binary properties: \p{IsAlphabetic} == \p{Alphabetic: Y}.FIX: Properly escape any problematic characters in Unicode tables.
Feb 12, 2018
FIX: bregex.compile now supports additional keyword arguments for named lists like bregex.compile_search does.
bregex.compile now supports additional keyword arguments for named lists like bregex.compile_search does.NEW: Start and end word boundary back references are now specified with \m and \M like Regex does. \< and \> have been removed from Regex.
\m and \M like Regex does. \< and \> have been removed from Regex.\< and \> are no longer processed as Re is known to escape these in versions less than Python 3.7.FIX: Process non raw string equivalent escaped Unicode on Python 2.7.
Feb 9, 2018
pattern.FIX: Formally enable Python 3.7 support.
Feb 8, 2018
FIX: Compiled search and replace objects should be hashable.
Jan 28, 2018
FIX: Bregex purge was calling Re's purge instead of Regex's purge.
Jan 22, 2018
FIX: Do not accidentally \. as a group in replace strings (don't use isdigit string method).
Jan 21, 2018
\. as a group in replace strings (don't use isdigit string method)._ in replace strings.\g<group> parsing better.NEW: Added new compile function that returns a pattern object that feels like Re's and Regex's pattern object.
Jan 20, 2018
compile function that returns a pattern object that feels like Re's and Regex's pattern object.\e for escape character \x1b in both Re and Regex.\R for generic newlines in the Regex module (Regex only).\pP and \PP.(?#comments) properly in the preprocess step.\N in byte strings (characters out of range won't be included).\p and \P in byte strings (characters out of range won't be included).\< and \> word boundary escapes.\Q...\E behavior so it is applied first as a separate step. No longer avoids \Q...\E in things like character groups or comments.Release candidate 1 for 2.3.0 ... will actually be released as 3.0.
Release candidate 1 for 2.3.0 ... will actually be released as 3.0.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
# 2.3.0b1 - Beta release for 2.3.0
NEW: Proper support for \N{Unicode Name}.
\N{Unicode Name}.\p should only be passed through if it is complete \p{category}. Python 3.7 will error on this if we pass it through, and Python 3.6 will generate warnings. We should just consistently fail on it for all Python versions.NEW: Handle Unicode and byte notation in Re replace templates.
subf and subfn.expandf to Regex that can take a format string and apply format style replaces.FORMAT flag to compile_replace to apply format style replaces when applicable.FIX: Fail on octal notation greater than \377 in byte strings.
\377 in byte strings.NEW: Handle Unicode and byte notation in Re replace templates.
subf and subfn.expandf to Regex that can take a format string and apply format style replaces.FORMAT flag to compile_replace to apply format style replaces when applicable.FIX: Issues related to downloading Unicode data and Unicode table generation. Include Unicode data in release.
Aug 06, 2017
One column per quarter.