Regex Tester

Pattern

/

/

g

g
i
m
s
u
y
Test String
Match Results
Example
The pin code is 4892 and the backup is 7310.
About

Regular expressions (regex) are a pattern language for matching and extracting text. They are supported in virtually every programming language and are essential for tasks like input validation, search-and-replace, and parsing structured data from logs or documents.

How to use
  1. 1.

    Enter your regular expression in the pattern field

  2. 2.

    Paste test text below - all matches are highlighted in real time

  3. 3.

    Use the flags (g, i, m, s, u, y) to adjust matching behaviour

Common uses
  • Testing regex patterns for form validation (email, phone, postal code)

  • Extracting structured data from log files or raw text

  • Building search-and-replace patterns for scripts or editors

Frequently asked questions
Which regex flavor does this use?

This tool uses JavaScript's built-in RegExp engine, which follows the ECMAScript regex specification. Patterns work the same as in Node.js and browser JavaScript.


How do I enable case-insensitive matching?

Click the i flag chip below the pattern field to toggle it on. All six flags (g, i, m, s, u, y) can be toggled independently.


What does the g flag do?

The global flag (g) finds all matches in the text instead of stopping after the first one. Match count and highlights update accordingly.


Is my text sent to a server?

All matching runs locally in your browser. No text or patterns are transmitted anywhere.


Why does my pattern match unexpectedly?

Special characters like . * + ? ( ) [ ] { } | ^ $ have meaning in regex. Escape them with a backslash if you want to match them literally (e.g., \. to match a period).