skillfed

types-regex

Typing stubs for regex

types-regex v2026.7.19.20260720 2.6M downloads/30d#2,994 on PyPI37
Permissive license Apache-2.0 Active released

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-regex

uv

uv add types-regex

poetry

poetry add types-regex

Installing 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

Programming Language :: Python :: 3Typing :: Stubs Only

Tags

type stubs for regexregex type annotationsmypy regex typespyright regex stubstyping support for regex
type-stubsstatic-analysis

More Software Development packages