Tools

Formateador y Tester de Expresiones Regulares

Construye, prueba y explica expresiones regulares con resaltado en tiempo real

RegExpJavaScriptSplit · Replace

Expresión regular

Escribe el patrón, activa los flags que necesites y valida al instante con el motor nativo de JavaScript.

//g

Texto de prueba

Pega cualquier texto largo y observa cómo cambian las coincidencias en tiempo real.

3 coincidencias encontradas
usuario@email.com
otro.usuario+test@dominio.es
correo-invalido@
contacto@analyticslane.com

Matches detallados

Selecciona una fila para resaltar esa coincidencia dentro del texto.

#MatchPosiciónLongitudGrupos de captura
1[email protected]0 - 1717
$1usuario$2email.com
2[email protected]18 - 4628
$1otro.usuario+test$2dominio.es
3[email protected]64 - 9026
$1contacto$2analyticslane.com
Matchuserdomain
Match 1usuarioemail.com
Match 2otro.usuario+testdominio.es
Match 3contactoanalyticslane.com

Explicador del patrón

Desglose visual token por token de la expresión regular actual.

(?<user>Inicio del grupo nombrado user (#1).
[\w.+-]Clase de caracteres [\w.+-].
+Una o más repeticiones (greedy).
)Fin del grupo 1.
@Literal exacto @.
(?<domain>Inicio del grupo nombrado domain (#2).
[A-Za-z0-9.-]Clase de caracteres [A-Za-z0-9.-].
+Una o más repeticiones (greedy).
\.Carácter escapado \. tratado como literal.
[A-Za-z]Clase de caracteres [A-Za-z].
{2,}Entre 2 y repeticiones.
)Fin del grupo 2.

About this tool

Regular expressions describe text patterns through a formal syntax based on finite automata. A pattern like ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,} validates an email address combining anchors (^, $), character classes ([a-zA-Z0-9]), quantifiers (+, {2,}), and escaped literals (\.). The regex engine compiles the pattern into a non-deterministic finite automaton (NFA) and evaluates it against the input text.

Errors in regular expressions are hard to detect because the expression may be syntactically correct but semantically wrong: it works for the test cases but fails in production with unexpected inputs. Capture groups (...) allow extracting parts of the text that match subpatterns, and flags modify engine behavior: g to find all matches, i to ignore case, m so that ^ and $ match line start and end.

This tool lets you test regular expressions in real time. Matches are highlighted visually, capture groups are shown separately, and flags can be toggled interactively. Includes a quick syntax reference.