--- id: regex version: "2026.7.19" license: Apache-2.0 AND CNRI-Python license_treatment: permissive maintenance: active --- # regex — Alternative regular expression module, to replace re. License: permissive · Maintenance: active · Popularity: top 100 on PyPI ## Install pip install regex uv add regex poetry add regex ## Description Introduction ------------ This regex implementation is backwards-compatible with the standard 're' module, but offers additional functionality. Python 2 -------- Python 2 is no longer supported. The last release that supported Python 2 was 2021.11.10. PyPy ---- This module is targeted at CPython. It expects that all codepoints are the same width, so it won't behave properly with PyPy outside U+0000..U+007F because PyPy stores strings as UTF-8. Multithreading -------------- The regex module releases the GIL during matching on instances of the built-in (immutable) string classes, enabling other Python threads to run concurrently. It is also possible to force the regex module to release the GIL during matching by calling the matching methods with the keyword argument ``concurrent=True``. The behaviour is undefined if the string changes during matching, so use it *only* when it is guaranteed that that won't happen. Unicode ------- This module supports Unicode 17.0.0. Full Unicode case-folding is supported. Flags ----- There are 2 kinds of flag: scoped and global. Scoped flags can apply to only part of a pattern and can be turned on or off; global flags apply to the... ## AI interpretation — verify before relying A drop-in replacement for Python's standard `re` module that adds Unicode 17.0.0 support, nested set operations, fuzzy matching, and advanced pattern features while maintaining backwards compatibility. Verdict: A well-maintained, actively developed regex engine for Python 3.10+ that extends the standard library with Unicode 17.0.0, nested sets, and fuzzy matching while remaining backwards-compatible. No known vulnerabilities, permissive dual licensing, and top-100 PyPI popularity make it a solid choice for projects needing advanced pattern matching beyond the standard `re` module. [View on SkillFed](https://skillfed.io/packages/regex) · [View on PyPI](https://pypi.org/project/regex/)