Skip to main content

A wrapper around re and regex that adds additional back references.

Project description

Donate via PayPal Discord Build Coverage Status PyPI Version PyPI Downloads PyPI - Python Version License

Backrefs

Backrefs is a wrapper around Python's built-in Re and the 3rd party Regex library. Backrefs adds various additional back references (and a couple other features) that are known to some regular expression engines, but not to Python's Re and/or Regex. The supported back references actually vary depending on the regular expression engine being used as the engine may already have support for some.

from backrefs import bre
>>> pattern = bre.compile(r'(\p{Letter}+)')
>>> pattern.sub(r'\C\1\E', 'sometext')
'SOMETEXT'

Documentation

https://facelessuser.github.io/backrefs/

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

backrefs-5.6.post1.tar.gz (5.4 MB view hashes)

Uploaded Source

Built Distributions

backrefs-5.6.post1-py312-none-any.whl (398.1 kB view hashes)

Uploaded Python 3.12

backrefs-5.6.post1-py311-none-any.whl (392.2 kB view hashes)

Uploaded Python 3.11

backrefs-5.6.post1-py310-none-any.whl (380.4 kB view hashes)

Uploaded Python 3.10

backrefs-5.6.post1-py39-none-any.whl (380.4 kB view hashes)

Uploaded Python 3.9

backrefs-5.6.post1-py38-none-any.whl (369.5 kB view hashes)

Uploaded Python 3.8

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page