NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #1140 most downloaded on PyPI
A wrapper around re and regex that adds additional back references.
Last release 2 months ago
26 Jul 2026
Ships fairly regularly
a new release about every 4 months
Nearly every release is documented
notes for 51 of 53 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
61 releases · first in 2016
NEW : Backrefs will preemptively fail, raising a PatternError , if parsing and finding an unterminated character set ( [] ) or an unterminated subpatt
PatternError, if parsing and finding an unterminated character[]) or an unterminated subpattern (()). Both re and regex already do this (re just issues a warningbackrefs will now terminate parsing early instead of waiting for the underlying regular7.0 until migration is possible.PatternError in bre if global flag syntax is not used at the start of there already does this, except on Python 3.10 where a warning is raised. Backrefs will now do thisbre, even on Python 3.10, to prevent backtracking in Backrefs' parser when global flags are redefined. If the7.0 until migration is possible.PatternError in bregex if a global flag is not used at the start of the(?i)) as regex allows this to be(...)) and affects the pattern after its insertion whether in a subpattern or outside a7.0 until migration is possible.ValueError and SyntaxError that used to be raised by the bre or bregex parser are nowbackrefs.util.PatternError.bregex related to regex handling of inline flags using global syntax.One column per quarter.
BREAK : Remove deprecated \e and \h support.
\e and \h support.non_joining, but should have beenno_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 spe
[[:alnum:]], [[:digit:]],[[:xdigit:]], and [[:punct:]]. To explicitly use standard Unicode rules for these compatibility properties, use[\p{Alnum}], [\p{Digit}], [\p{Punct}], or [\p{XDigit}]. This has changed(?a:pattern)/(?u:pattern)) should be respected for Unicode properties inbre 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.NEW: Added the following binary properties for Unicode 13.0 support (Python 3.9): emoji, emojicomponent, emojimodifier, emojimodifierbase, and emojipr
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.
format_spec.NEW: Add support for generic line breaks (\R) to Re.
\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.
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
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.
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.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
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.Nothing published for this version
Nothing published for this version
FIX: Issues related to downloading Unicode data and Unicode table generation. Include Unicode data in release.
Aug 06, 2017
## 1.0.1 Releases > Jan 16, 2017 - FIX: Fixes for Python 3.6.
Jan 16, 2017
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →