Constructor de Regex

Construye y prueba expresiones regulares visualmente.

Motor en Tiempo Real
/
/g
7 Coincidencias Encontradas
Hello World! This is a Regex Test with Multiple Matches.

Plantillas Comunes

Guía Rápida de Regex
\dCualquier dígito
\wCualquier carácter de palabra
.Cualquier carácter
*0 o más
+1 o más
^ / $Inicio / Fin

¿Por qué usar este constructor?

Resaltado en VivoLas coincidencias se mapean visualmente en el panel de vista previa mientras escribes.
RegEx EstándarUsa el motor de regex JavaScript V8 para máxima compatibilidad.
Sin SobrecargaPrueba fragmentos rápidamente sin abrir un IDE pesado.

Demystifying Regular Expressions

Overview

Regular expressions are a tiny domain-specific language for matching text patterns. They turn problems like 'find all email addresses' or 'extract date strings' into one-liners — but the cryptic syntax intimidates many developers. This builder helps you compose regex patterns visually, see live matches on test text, and learn the syntax piece-by-piece. It supports JavaScript's regex flavor (closest to most other modern engines).

How It Works

Type a pattern in the regex field; type test text in the test area. As you type, the tool highlights every match in real time. Groups and named groups are color-coded. The tool generates explanation text for each part of your pattern ('\d+ matches one or more digits') and warns about common mistakes (greedy quantifiers, missing escapes, unintended character classes).

When to Use This

Validating form input (email format, phone numbers, postal codes). Extracting data from log files. Find-and-replace in code editors. Building URL routing patterns. Parsing user-entered text. Sanitizing HTML or SQL. Splitting CSV with quoted fields. Designing regex for use in another tool (sed, grep, your code).

Frequently Asked Questions

Why does my regex match too much / too little?

Most common issue: greedy quantifiers. '.*' matches as much as possible; use '.*?' for lazy matching. Also check for character class issues — '[a-z]' doesn't match uppercase; '[a-zA-Z]' or the 'i' flag does.

When should I NOT use regex?

Parsing HTML or XML (use a DOM parser). Parsing nested structures (regex can't handle arbitrary nesting). Parsing email addresses to RFC spec (the full regex is 6000+ characters). Use proper parsers for these.

Are regex patterns portable across languages?

Mostly, but with edge cases. PCRE (PHP), Java, Python, JavaScript share most syntax. POSIX regex (basic sed/grep) lacks features like \d or non-capturing groups. Always test in the target environment.

Herramientas recomendadas

Utilidades seleccionadas que podrían serte útiles