Cubestack

Regex Tester

Free regex tester online — test JavaScript regular expressions with live highlighting, groups and replace.

//g

Ready-made patterns

Test text
Matches · 1
Write to hello@cubestack.in or call +91 98765 43210. Office PIN 560001, PAN ABCDE1234F, invoice dated 05/11/2026.
Match details
#MatchPositionGroups
1hello@cubestack.in9—

What is the Regex Tester?

A regex tester lets you write a regular expression and immediately see what it matches in sample text. Cubestack uses the JavaScript RegExp engine, highlights every match and lists capture groups as you type.

How to use it

  1. 1

    Write a pattern

    Enter your regular expression and flags.

  2. 2

    Add test text

    Paste sample text to match against.

  3. 3

    Inspect matches

    Review highlighted matches and capture groups.

Features

  • Live highlighting

    Matches are highlighted in the test text as you edit the pattern.

  • Flags support

    Use g, i, m, s, u and y flags just like in JavaScript.

  • Capture groups

    See each match with its numbered and named groups.

  • Clear errors

    Invalid patterns show the engine's error message.

Popular uses

  • Validation

    Build patterns for emails, phone numbers and postcodes.

  • Data extraction

    Pull IDs, dates or URLs out of logs and text.

  • Find and replace

    Perfect a pattern before using it in your editor or code.

Frequently asked questions

Which regex flavor is used?

JavaScript (ECMAScript) regular expressions — the same engine used in browsers and Node.js.

What does the g flag do?

The global flag finds all matches instead of stopping after the first.

Does it support lookbehind?

Yes, modern browsers support lookahead and lookbehind assertions.

Related tools