pastefix

Regex Tester & Explainer

Pattern
//
Test String
Analysis

How to use

Enter your regex pattern in the input field and set the flags (g, i, m, s, u, y) as needed. Type or paste a test string below the pattern to see matches highlighted in real time. The tool instantly breaks down every token in your pattern and shows what each part does. Click "Explain with AI" for a natural-language walkthrough of your entire expression.

What this tool does

Pastefix's Regex Tester validates your regular expression, parses it into individual tokens with human-readable descriptions, and tests it against your input string — all in real time. It shows match results with capture groups so you can iterate on patterns without leaving the page.

Common use cases

  • Building and debugging regex for form validation (emails, phone numbers, URLs)
  • Writing patterns for log parsing and data extraction pipelines
  • Learning regex syntax with instant visual feedback on each token
  • Testing patterns before embedding them in code or CI/CD configs
  • Verifying capture groups and backreferences for search-and-replace operations

Frequently Asked Questions

Which regex flavor does this use?

Pastefix uses JavaScript's native RegExp engine, which supports all modern flags including dotAll (s), unicode (u), and sticky (y). Patterns are tested exactly as they would run in a browser or Node.js environment.

Can I test multiple strings at once?

Enter a multi-line test string — each line is tested individually against your pattern. The global (g) flag finds all matches within each line.

Is my regex data sent anywhere?

No. Pattern testing and token analysis happen entirely in your browser. Only clicking "Explain with AI" sends data to a server for analysis.

Do I need to escape forward slashes?

No. Unlike writing regex in code, you do not need to escape slashes in the pattern input — just type the pattern directly.