Skip to main content

📦 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.

npm pypi crates.io packagist pkg.go.dev Tested & Visualized Live


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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

regexto_validators-1.0.3.tar.gz (24.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

regexto_validators-1.0.3-py3-none-any.whl (58.0 kB view details)

Uploaded Python 3

File details

Details for the file regexto_validators-1.0.3.tar.gz.

File metadata

  • Download URL: regexto_validators-1.0.3.tar.gz
  • Upload date:
  • Size: 24.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for regexto_validators-1.0.3.tar.gz
Algorithm Hash digest
SHA256 94331fe75baccbc4e74c904abe1be1ec92cc1872e2166b79443c0e5220318f49
MD5 af987801bc37148dc4b82963ef346b64
BLAKE2b-256 cf2f1735878d6e4e383912f9e580685a2e76aceaeffd216e70242ad3db9b4ca9

See more details on using hashes here.

File details

Details for the file regexto_validators-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for regexto_validators-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b87c8bb6bd8ac3e449c48b9a0d1e187175989028e72b3a85ea01ddcf3b38fdb5
MD5 a6d18a0c3bc0c374a07c92457f3f23f5
BLAKE2b-256 fac6867921e74f59bfe1e26edaec4f5cd16b9d0a4e0d463cfb7031250469b275

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 files

1.0.2

2 files

1.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page