Skip to content
Kordu Tools
Developer Tools Runs in browser Popular Updated 30 Mar 2026

Regex Tester

Test regular expressions live with color-coded match highlighting, capture groups, replace mode, and common presets.

Test text

44 chars

Preview

The quick brown fox jumps over 13 lazy dogs.

Matches

9 found

Match 1

0 to 3

The

Match 2

4 to 9

quick

Match 3

10 to 15

brown

Match 4

16 to 19

fox

Match 5

20 to 25

jumps

Match 6

26 to 30

over

Match 7

31 to 33

13

Match 8

34 to 38

lazy

Match 9

39 to 43

dogs

Presets

Loading rating…

How to use Regex Tester

  1. Enter your regex pattern

    Type your regular expression into the pattern input. Do not include the leading and trailing slashes — just the pattern itself.

  2. Set flags

    Toggle flags: g (global, find all matches), i (case-insensitive), m (multiline, ^ and $ match line boundaries), s (dotAll, dot matches newlines), and u (unicode mode).

  3. Add your test text

    Paste or type the text you want to test against in the textarea. Matches are highlighted inline in real time as you type.

  4. Review match details

    The match panel shows the total number of matches, each match's full text and position, and all capture group values including named groups.

  5. Test replace mode

    Switch to Replace mode and enter a replacement string using $1, $2 for numbered groups or $<name> for named groups. The substituted output is shown live.

Regex Tester FAQ

What regex engine does this use?

JavaScript's native RegExp engine (ECMAScript 2024), which is the same engine used in Node.js, Chrome, Firefox, Safari, and Edge. Syntax is mostly compatible with PCRE, with some differences: no lookbehind in older engines (lookbehind is supported in modern V8), no possessive quantifiers, and no atomic groups.

Can I test capture groups?

Yes. The match details panel shows every capture group for each match, including named groups (?<name>) if your pattern uses them. Named groups appear with both their name and index.

How do I use replace mode?

Toggle Replace mode and enter a replacement string. Use $1, $2 etc. for numbered capture groups, $<name> for named groups, $& for the full match, $` for the text before the match, and $' for the text after. The result updates live.

What flags are supported?

g (global — find all matches, not just the first), i (case-insensitive), m (multiline — ^ and $ match line start/end), s (dotAll — . matches newlines), u (unicode — treat pattern and string as UTF-16 code points), and d (indices — include match position indices).

Is there a way to start with a common regex pattern?

Yes. Use the Presets dropdown to load tested patterns for common cases: email addresses, URLs, IPv4, IPv6, phone numbers, dates, hex colors, postal codes, and more. Customise the loaded pattern as needed.

Is my test data sent anywhere?

No. All regex matching happens in your browser using the native JavaScript RegExp API. Your patterns and test strings never leave your device.

Why does my pattern work in Python/PHP but not here?

JavaScript's regex flavour differs from PCRE used in Python and PHP. Key differences: no possessive quantifiers, no conditionals, no inline modifiers (?i), and lookbehind has some length restrictions. Use the u flag for full Unicode support.

Can I test multiline text?

Yes. Paste any multiline text into the test area. Without the m flag, ^ and $ match the start and end of the entire string. With the m flag, they match the start and end of each line. Use the s flag to make . match newlines.

How do I match a literal dot or special character?

Escape special regex characters with a backslash: \. matches a literal dot, \* matches a literal asterisk. Special characters in regex are: . * + ? ^ $ { } [ ] | ( ) \

Background

Regex Tester is built for developers who need to write, debug, and verify regular expressions without leaving the browser. Enter your pattern and test string and matches are highlighted inline with distinct color-coded spans — each match group gets its own color so you can see overlapping and nested captures at a glance.

The match details panel lists every match with its start position, full match text, and all captured groups (including named captures). Toggle between match mode and replace mode: in replace mode, enter a replacement string using JavaScript's replacement syntax ($1, $2, $&, $`, $', named captures) and see the substituted output live.

Flag toggles give you one-click access to g (global), i (case-insensitive), m (multiline), s (dotAll), and u (unicode) flags. Built-in presets for email addresses, URLs, IPv4, IPv6, dates, phone numbers, and hex colors let you start from a proven pattern and customise from there.

Uses JavaScript's native RegExp engine (ECMAScript 2024), the same engine that runs in Node.js, V8, and all modern browsers. All processing is client-side — your patterns and test data never leave your browser.

Learn more