Test regular expressions live, highlight matches and preview replacements.
{{ replaceResult }}
| # | Match | Index | Groups |
|---|---|---|---|
| {{ i + 1 }} | {{ m.value }} |
{{ m.index }} | — ${{ gi + 1 }}: {{ g ?? 'undefined' }} |
{{ item.token }} |
{{ item.desc }} |
Regular expressions (RegEx) are powerful search patterns used in text processing and programming. They allow you to define complex string patterns to search, validate, extract or replace text. Almost every programming language — from JavaScript to Python to PHP — supports regular expressions.
RegEx is used for email validation, phone number detection, URL parsing, log analysis, data extraction from HTML, search-and-replace in code editors and much more. Our online RegEx tester uses the JavaScript RegExp engine, so you can test patterns directly in your browser.
*?, +?) when you need the shortest match.() to extract parts of a match and use them in replacements.(a+)+ can cause catastrophic backtracking.