Probador de RegEx

Ingresa un patrón de expresión regular y texto de prueba para ver coincidencias resaltadas en tiempo real. Muestra grupos de captura, información de coincidencias y cuenta de resultados. Incluye referencia rápida de sintaxis y patrones comunes.

//g

Highlighted Text

Enter text to test against...

Match Details

Enter text to test against...

¿Tienes una sugerencia?

Solicita una nueva herramienta o sugiere mejoras — ¡únete a nuestra comunidad en Slack!

Dejar feedback en Slack

What is a Regular Expression?

A regular expression (regex or regexp) is a sequence of characters that defines a search pattern. Originally developed in the 1950s by mathematician Stephen Kleene, regex is now fundamental to text processing in virtually every programming language including JavaScript, Python, Java, and more. Regular expressions can match, search, extract, and replace text based on complex patterns — from simple literal matches to sophisticated patterns involving character classes, quantifiers, lookaheads, and capture groups. This tester lets you experiment with regex patterns in real time, seeing matches highlighted instantly with detailed group information.

How to Use This Regex Tester

  1. Enter your regular expression pattern in the Pattern field
  2. Toggle the flags you need (g for global, i for case-insensitive, m for multiline)
  3. Type or paste your test string in the Test String field
  4. View highlighted matches and capture group details in real time
  5. Optionally enter a replacement string to preview substitution results

Frequently Asked Questions

What regex flavor does this tester use?

This tester uses JavaScript's built-in RegExp engine, which supports ECMAScript 2024 features including named capture groups, lookbehind assertions, Unicode property escapes, and the dotAll (s) flag. The same patterns will work in Node.js, modern browsers, and TypeScript.

How do I match special characters like dots or brackets?

Special regex characters like . * + ? ^ $ { } [ ] ( ) | \ must be escaped with a backslash to match literally. For example, use \. to match a period, \[ to match an opening bracket, and \\ to match a backslash itself.

What are capture groups and how do I use them?

Capture groups are defined by parentheses () in your pattern. They extract specific portions of the match. For example, the pattern (\d{4})-(\d{2})-(\d{2}) captures year, month, and day separately from a date string. Named groups like (?<year>\d{4}) provide labels for easier access.

What is the difference between greedy and lazy quantifiers?

Greedy quantifiers (*, +, ?) match as much text as possible, while lazy versions (*?, +?, ??) match as little as possible. For example, given '<div>hello</div>', the pattern <.*> (greedy) matches the entire string, while <.*?> (lazy) matches only '<div>'.

Is my test data safe?

Yes. This regex tester runs entirely in your browser using JavaScript's built-in RegExp engine. No data is sent to any server. Your patterns and test strings never leave your device.

Herramientas Relacionadas