Toolivaro

Probador de regex gratis

Prueba expresiones regulares en vivo contra tu propio texto, con resaltado de coincidencias, grupos de captura y flags, todo local.

El probador de regex valida un patrón y muestra cada coincidencia contra tu propio texto mientras escribes, sin ida y vuelta a un servidor. Pega o escribe cualquier texto, introduce un patrón, activa los flags estándar (global, insensible a mayúsculas, multilínea, punto coincide con todo, unicode, sticky) y la herramienta lista cada coincidencia con su posición, el texto coincidente y los grupos de captura que ha producido. Los patrones se compilan con el motor RegExp ECMAScript de la plataforma, así que el comportamiento que pruebas aquí es exactamente el que obtienes en JavaScript, Node.js y cualquier navegador moderno: la herramienta promete fidelidad al motor, no un dialecto parecido. Los patrones mal formados devuelven el mensaje de error de la plataforma para que los corrijas rápido, y un tope de seguridad en el escaneo de coincidencias evita que los patrones patológicos congelen la página. Todo se ejecuta localmente en tu navegador: el texto que pegas —fragmentos de logs, configuración, datos personales— nunca se sube, registra ni almacena. Usa esta herramienta mientras escribes un validador, depuras un parser de logs o antes de confiar en un patrón en código de producción.

Se procesa localmente en tu navegador

Modificadores

Cómo usar esta calculadora

Building a pattern the way the engine sees it

A regular expression is a miniature program: the engine walks your text, and at every position it asks whether the pattern matches starting there. The tester makes that walk visible — every match is listed with its position, the exact text it matched, and the capture groups it produced, updated as you type. Start with the literal that must appear (request_id=, say), add the flexible parts around it (a w+ for the value), and check the result against real lines from your data before you trust it anywhere.

The engine here is the platform’s ECMAScript RegExp — the same one JavaScript, Node.js, Deno, and every modern browser use. That is the point of the tool’s fidelity promise: a pattern that matches here matches in your code, and one that fails here will fail there. Dialects like PCRE (PHP, grep, regex101’s default) have features ECMAScript lacks or spells differently — lookbehind syntax, named-group conventions, atomic groups — and the tester rejects them with the platform’s error message rather than pretending to support a dialect it does not run.

Using the flags deliberately

Flags are not decorations — they change what the pattern means. Without g, the engine stops at the first match, and the classic "why does my pattern match once?" confusion is usually a missing g. Without m, the anchors ^ and $ bind to the whole string, not to line boundaries, so a pattern that should match each log line silently matches nothing when the text has multiple lines. The s flag is the one that surprises everyone: . matches every character except line breaks unless s is set, so patterns that should span lines fail on the newline. And the difference between the unicode u and non-unicode modes changes how astral characters like emoji are treated — a point where the ECMAScript engine is stricter than older dialects.

The tester shows the flags you have set at a glance and re-runs the scan on every change, so each flag’s effect is visible the moment you toggle it. That is the fastest way to learn what a flag does: switch it, watch the match list change.

Reading matches, groups, and failures

Each result row shows the matched text, its start position, and its capture groups — the parts of the pattern inside parentheses, which are the values your code will actually consume. The classic use is extraction: with /request_id=(w+)/g against a log line, group 1 holds the id, and the tester shows both matches and their group values before you wire the pattern into a pipeline.

A pattern that matches nothing is a bug report, not a puzzle: the tool shows every match position so the failure is visible at a glance — the pattern matched a different place than you expected, or matched zero times because of a missing flag, a literal space, or an anchor bound to the wrong position. Malformed patterns return the platform’s own error message, which names the position of the problem, so fixing is a matter of reading the message rather than guessing.

Safety and the honest limits

Regular expressions can be pathological: certain patterns take exponential time on certain inputs — the classic "catastrophic backtracking" failure mode — and the tester caps match scanning so a hostile pattern cannot freeze the page. The cap is disclosed; extremely large texts or pathological patterns are truncated with a notice rather than run to completion.

Two things the tool deliberately does not do: it does not judge whether a pattern is efficient enough for production traffic (that is a load-testing question), and it does not claim your pattern is correct in the abstract — it shows what the engine does with your text, which is the only honest answer. And because patterns and pasted text often contain credentials and personal data, everything runs locally: nothing is uploaded, logged, or stored.

¿Cómo se calcula el resultado?

Extraer IDs de líneas de log

Con líneas de log como "2026-08-05 09:30 ERROR request_id=7f3a user=ada", el patrón /request_id=(\w+)/g coincide con cada request id y captura el valor en el grupo 1. El probador lista las dos coincidencias con sus posiciones y sus grupos capturados, para que confirmes el patrón antes de usarlo en un pipeline de logs.

Entrada y resultado del ejemplo
Entrada Valor
text 2026-08-05 09:30 ERROR request_id=7f3a user=ada 2026-08-05 09:31 ERROR request_id=9c21 user=bob
pattern request_id=(\w+)
flags g
Resultado 2 coincidencias · grupo 1: 7f3a, 9c21

¿Cuál es la fórmula y sus supuestos?

Semántica de coincidencia

matches = text.scan(pattern, flags)

Términos de la fórmula
Símbolo Significado
pattern expresión regular ECMAScript (motor RegExp de la plataforma)
flags g (global), i (ignorar mayúsculas), m (multilínea), s (punto coincide con todo), u (unicode), y (sticky)

El comportamiento es exactamente el del motor de la plataforma: lo que coincide aquí coincide en JavaScript, Node.js y los navegadores.

¿Cuáles son los errores más comunes?

  • Probar con el flag g pero leer solo el primer resultado: con /g el motor avanza por todas las coincidencias.
  • Esperar características de PCRE (como lookbehind anterior a ES2018) en un patrón ECMAScript.
  • Olvidar que . no coincide con saltos de línea salvo que el flag s esté activado.
  • Pegar patrones o textos con secretos en un servicio web: esta herramienta es totalmente local.

¿Cuáles son los supuestos y las limitaciones?

  • El dialecto es solo ECMAScript; las características estilo PCRE/RE2 que no están en ECMAScript se rechazan con el error de la plataforma.
  • El escaneo de coincidencias tiene un tope de seguridad; los textos extremadamente grandes o los patrones patológicos pueden truncarse con un aviso.
  • La herramienta muestra lo que coincide el motor: no puede juzgar si un patrón es eficiente o seguro para una carga de trabajo en producción.

¿De dónde salen los números?

Última revisión 5 de agosto de 2026 · Versión 1.0.0 · Toolivaro no garantiza el contenido externo.

Preguntas frecuentes

¿Qué dialecto de regex usa esta herramienta?

El motor ECMAScript de la plataforma: el mismo dialecto que usan JavaScript, Node.js, Deno y los navegadores. Dialectos como PCRE (PHP, grep, el predeterminado de regex101) tienen características extra, como lookbehind en formas distintas y grupos con nombre con sintaxis diferente; esas no forman parte de ECMAScript.

¿Por qué mi patrón no ha coincidido con nada?

Causas habituales: falta el flag g cuando esperas varias coincidencias, olvidar que los anclajes como ^ y $ solo coinciden con límites de línea con el flag m, y patrones que incluyen espacios literales sin querer. La herramienta muestra cada coincidencia con su posición, así que el fallo suele verse de un vistazo.

¿Mi texto se envía a algún sitio?

No. El patrón y el texto se procesan íntegramente en la pestaña de tu navegador: nada se sube, registra ni almacena. Esto importa con fragmentos de logs y archivos de configuración que a menudo contienen credenciales o datos personales.

What does the u (unicode) flag actually change?

It switches the engine to strict Unicode mode: astral characters (emoji, rare scripts) are treated as single code points instead of surrogate halves, and some otherwise-lenient syntax becomes an error. Patterns that work without u can behave differently with it — the tester makes the difference visible as you toggle.

Can I use the same pattern in Python or Go?

Not safely — those languages use different engines (Python’s re, Go’s RE2). The fidelity promise here is specifically ECMAScript: what matches here matches in JavaScript, Node.js, Deno, and browsers. Porting a pattern to another language means re-testing it in that language’s tester.

Parte de Kit de herramientas de texto y JSON para desarrolladores

¿Encontraste un error o tienes una corrección? Repórtalo: revisamos cada corrección.

¿Te ha sido útil?

Revisado por el equipo editorial de Toolivaro según nuestra metodología Metodología · Política editorial