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.2.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.2-py3-none-any.whl (58.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: regexto_validators-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 47b7e75f8271666c61c476b67554fe5c1662f09dd2ef360832811dee73cac30c
MD5 ee56b9cd9bde5d16bea3dc98af7c4ba0
BLAKE2b-256 18efbba5f238e1592283a63f1f4563af00ee49823be16568896ba4bef9530b02

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for regexto_validators-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7a2b8b153224f73728f57490a16c1091efaad1b9693ad85c0a75b3ed12c15f57
MD5 8c531928c6ee0656fec502b4717f64d5
BLAKE2b-256 33b315b1fad6a63aae3e737db72262a16bedc90e38c579b77b4d8d3fbd68306c

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.3

2 files

This release

1.0.2 This release

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