A curated collection of battle-tested regex patterns with Python validation.
Project description
📦 regexto-validators (Python)
Curated, production-ready, and battle-tested regex patterns for Python, backed by the regex.to pattern registry.
All patterns are open-source, fully tested, and visualized live on regex.to.
Why regexto-validators?
- 🔍 Tested and Visualized Live: Every single pattern in this library can be searched, tested, and visualized interactively at regex.to.
- 🚀 Zero Dependencies: Pure Python validation. Lightweight and lightning-fast.
- 📁 JSON Single Source of Truth: Patterns are declared declaratively in standard JSON files shared across multiple languages.
Installation
pip install regexto-validators
Quick Start
1. Basic Validation (Python)
from regexto_validators import validate, test
# 1. Quick boolean test (substring match)
test('email', 'contact me at user@example.com') # → True
test('email', 'invalid-email') # → False
# 2. Strict full-string validation
is_valid = validate('ipv4', '192.168.1.1') # → True
2. Smart Type Auto-Detection
Pass an unknown string, and the validator will identify matching formats:
from regexto_validators import detect
matches = detect('0x742d35Cc6634C0532925a3b844Bc454e4438f44e')
# → [{'pattern': {'slug': 'ethereum-address', ...}, 'matchType': 'full', 'coverage': 1.0}]
Available Patterns
Here is a curated subset of the 79+ patterns supported. View all of them and test them live at regex.to/patterns:
| Slug | Name | Category | Live Sandbox |
|---|---|---|---|
email |
Email Address | Internet | Test Live ↗ |
url |
URL (HTTP/HTTPS) | Internet | Test Live ↗ |
ipv4 |
IPv4 Address | Network | Test Live ↗ |
ipv6 |
IPv6 Address | Network | Test Live ↗ |
hex-color |
Hex Color | Design | Test Live ↗ |
semver |
Semantic Version | Dev | Test Live ↗ |
uuid |
UUID | Dev | Test Live ↗ |
credit-card |
Credit Card Number | Finance | Test Live ↗ |
iban |
IBAN | Finance | Test Live ↗ |
pl-nip |
Polish NIP (Tax ID) | Finance | Test Live ↗ |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file regexto_validators-1.0.1.tar.gz.
File metadata
- Download URL: regexto_validators-1.0.1.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fc06f6b70aa687d49dd0fc111d59bc10bdb3e24a21198b9ebe5686d98c2c63b
|
|
| MD5 |
73fa08b4db31a74555b17b5b732a03dc
|
|
| BLAKE2b-256 |
a06cdd5cfe692681a2ed904a2c2c52bf79a9005a065a21a94e24275f6279d50e
|
File details
Details for the file regexto_validators-1.0.1-py3-none-any.whl.
File metadata
- Download URL: regexto_validators-1.0.1-py3-none-any.whl
- Upload date:
- Size: 53.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb8e1bc8ca9019f4d5bba2a1687cb8c7d7d5182c0dafd6eda4bac55c6f32ccea
|
|
| MD5 |
209f4b020dc0e287a39bd5b242fcbeec
|
|
| BLAKE2b-256 |
132dccaa91e6900ff37619c5b867a3dfd8ca5a846295d3f8db778d4059e2317e
|