--- id: types-regex version: "2026.7.19.20260720" license: Apache-2.0 license_treatment: permissive maintenance: active --- # types-regex — Typing stubs for regex License: permissive · Maintenance: active · Downloads: 2.6M/mo ## 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 above — 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 pip install types-regex uv add types-regex 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_current - Install friction: low - Maintenance: active - Downloads: 2.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags type stubs for regex, regex type annotations, mypy regex types, pyright regex stubs, typing support for regex, type-stubs, static-analysis [View on SkillFed](https://skillfed.io/packages/types-regex) · [View on PyPI](https://pypi.org/project/types-regex/)