Skip to content

Generador y explicador de regex

Genera una expresión regular a partir de cadenas de ejemplo y explica cualquier regex parte por parte en lenguaje claro. Basado en reglas, en tu navegador.

Sin subidas
  • ✓ Generalised from your examples · matches 3/3, rejects 2/2

    ^\d{4}-\d{2}-\d{2}$
  • ✓ ISO date (YYYY-MM-DD) · matches 3/3, rejects 2/2

    ^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])$
  • ✓ Exact alternatives · matches 3/3, rejects 2/2

    ^(?:2024-01-15|1999-12-31|2026-10-14)$

Cómo usar Generador y explicador de regex

  1. 1Abre Generador y explicador de regex. Funciona en tu navegador, sin registro.
  2. 2Escribe o pega tus datos.
  3. 3Copia o descarga el resultado.

Preguntas

How is the regex generated?

Your examples are split into runs of digits, letters and punctuation. If they share a structure, those runs become character classes with lengths; common formats like emails, dates and UUIDs are also checked against your examples.

Is AI involved?

No. It is rule-based and runs entirely in your browser.

Which regex flavour?

JavaScript (ECMAScript). Most patterns also work in PCRE, Python and Go.

Más herramientas