Flags
69 chars
Highlighted matches13 matches
Edit this text to see matches. The regex engine runs in your browser.

Match details

  • Match 1index 0 · length 4
    Edit
  • Match 2index 5 · length 4
    this
  • Match 3index 10 · length 4
    text
  • Match 4index 15 · length 2
    to
  • Match 5index 18 · length 3
    see
  • Match 6index 22 · length 7
    matches
  • Match 7index 31 · length 3
    The
  • Match 8index 35 · length 5
    regex
  • Match 9index 41 · length 6
    engine
  • Match 10index 48 · length 4
    runs
  • Match 11index 53 · length 2
    in
  • Match 12index 56 · length 4
    your
  • Match 13index 61 · length 7
    browser

Test and debug regular expressions in your browser

Regular expressions are one of the most powerful tools in a developer's toolkit, but they're also notoriously easy to get wrong. This tester gives you a live, interactive sandbox: type a pattern, toggle the flags you need, paste in some text, and watch every match light up. Capture groups and named groups show up in the match details panel so you can verify your extraction logic before shipping it to production.

How to use the tester

Enter your pattern in the input — no delimiters needed, just the expression itself. Toggle g to find all matches, i for case-insensitive matching, and m when you need anchors to apply per line. The test string area accepts any text you want to scan. Matches are highlighted in real time as you type, and the match count appears just above the preview. Use the quick-reference table on the side to drop common tokens like \d, \w, or \b into your pattern with a click.

Common patterns to try

Start with \b\w+\b to match every word, or \d+ to find numbers. Use [\w.+-]+@[\w-]+\.[\w.-]+ to spot email-like strings. Named groups such as (?<year>\d{4})-(?<month>\d{2}) make complex extractions readable. Whenever a pattern fails, the syntax error message points directly at the issue.

Private by design

Everything happens locally. The browser's RegExp engine compiles and runs your pattern, and the page never sends your text or expression to any server. That makes this tool safe for log fragments, sample customer data, or any sensitive content you want to experiment with.

Questions

Frequently asked questions

What is a regular expression?

A regular expression (regex) is a sequence of characters that defines a search pattern. Regex is used to find, match, and replace text — common tasks include validating email addresses, extracting URLs, parsing log files, and search-and-replace in code editors. This tool uses your browser's native RegExp engine, the same one JavaScript uses at runtime.

What do the flag toggles do?

Each flag changes how the regex engine matches. g (global) finds every match instead of stopping at the first. i (case-insensitive) treats A and a as equal. m (multiline) makes ^ and $ match the start and end of each line. s (dotAll) lets the dot match newline characters. u (unicode) enables full Unicode support including surrogate pairs and \p{} property escapes. y (sticky) requires the match to start exactly at the regex's lastIndex.

Why does my pattern show a syntax error?

The tool reports the exact error message thrown by the browser's regex engine. Common causes are unbalanced parentheses, an unfinished character class like [abc, an invalid escape such as \j, or a backreference to a group that doesn't exist. Check the highlighted message — it usually points to the problem character.

How do capture groups and named groups work?

Parentheses (abc) create a capture group whose matched text appears in the match details under $1, $2, and so on. Named groups use the (?<name>abc) syntax and appear in the named groups section. Use (?:abc) when you want to group without capturing, which keeps the numbering simple and improves performance.

Is my pattern or test string sent to a server?

No. Everything runs locally in your browser using the built-in RegExp object and String.prototype.matchAll. No data leaves your device, nothing is uploaded, and the tool works offline once the page is loaded.