Tools
Formateador y Tester de Expresiones Regulares
Construye, prueba y explica expresiones regulares con resaltado en tiempo real
Expresión regular
Escribe el patrón, activa los flags que necesites y valida al instante con el motor nativo de JavaScript.
Texto de prueba
Pega cualquier texto largo y observa cómo cambian las coincidencias en tiempo real.
Matches detallados
Selecciona una fila para resaltar esa coincidencia dentro del texto.
| # | Match | Posición | Longitud | Grupos de captura |
|---|---|---|---|---|
| 1 | [email protected] | 0 - 17 | 17 | $1 usuario$2email.com |
| 2 | [email protected] | 18 - 46 | 28 | $1 otro.usuario+test$2dominio.es |
| 3 | [email protected] | 64 - 90 | 26 | $1 contacto$2analyticslane.com |
| Match | user | domain |
|---|---|---|
| Match 1 | usuario | email.com |
| Match 2 | otro.usuario+test | dominio.es |
| Match 3 | contacto | analyticslane.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.
Articles published on the blog
