types-regex
Typing stubs for regex
What it is and what it does
types-regex is a type stub package that provides static type annotations for the regex library. It allows Python type checkers to understand and validate code that uses the regex module, catching type errors before runtime. The package is maintained as part of typeshed, the standard repository of type stubs for the Python ecosystem, and is regularly tested against current versions of mypy and pyright.
When installed alongside regex, this package enables IDE autocompletion, type checking in CI/CD pipelines, and better code documentation through type hints. It has no runtime dependencies and adds no overhead to your application—it exists purely to inform type checkers during development and static analysis.
Use it for:
- Enable mypy or pyright to type-check code using the regex library in a CI/CD pipeline.
- Get IDE autocomplete and type hints when writing regex patterns and method calls.
- Catch type mismatches (e.g., passing wrong argument types to regex functions) before deployment.
- Document regex usage in your codebase through static type information for other developers.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides type annotations for the regex package, enabling type checkers like mypy and pyright to validate code that uses regex.
Yes, if you use the regex package and run type checking in your workflow. Install it alongside regex to enable full type support. If you don't use a type checker or don't use the regex library, there's no benefit.
Install
types-regex on PyPI
pip
pip install types-regexuv
uv add types-regexpoetry
poetry add types-regexInstalling types-regex
Before you install
Low install friction; no runtime dependencies. Actively maintained as part of typeshed, with recent updates and tested against mypy 2.3.0 and pyright 1.1.411.
License in practice
Licensed under Apache-2.0 (permissive), allowing use in both open-source and proprietary projects without significant restrictions.
Quickstart
pip install types-regex
# Then use regex with type checking enabled in your IDE or CI
import regex
pattern = regex.compile(r'\w+')
Requires Python 3.10 or later. This package is only useful when used alongside a type checker (mypy, pyright, etc.) in your development workflow.
Verify before relying
- Whether this stub package remains synchronized with the latest regex package versions beyond 2026.7.19.
- Coverage completeness: whether all public regex APIs are fully annotated or if some remain untyped.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 25 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,577,215/month — #2,994 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: types_regex-2026.7.19.20260720-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
types-jmespathProvides type annotations for the jmespath…
permissive · top 5,000 on PyPI
types-jwcryptoProvides type annotations for the jwcrypto…
permissive · top 15,000 on PyPI
types-mypy-extensionsProvides type stubs for mypy-extensions,…
permissive · top 15,000 on PyPI
types-simplejsonProvides type annotations for the simplejson…
permissive · top 5,000 on PyPI
types-pyperclipProvides type annotations for the pyperclip…
permissive · top 15,000 on PyPI
types-boltonsProvides type stubs for the boltons library,…
permissive · top 15,000 on PyPI
types-MarkdownProvides type stubs for the Markdown package,…
permissive · top 5,000 on PyPI
types-pyflakesProvides type stubs for the pyflakes static…
permissive · top 15,000 on PyPI
types-croniterProvides type stubs for the croniter package,…
permissive · top 5,000 on PyPI
google-re2-stubsProvides type stubs for the google-re2 package,…
permissive · top 15,000 on PyPI