Quick answer: A NimbusCalc regex tester runs your pattern against a test string and shows every match, its start and end index, and its capture groups. Type the pattern into Regular expression pattern with no surrounding slashes, paste text into Test string, tick the five flag checkboxes, and press Test and highlight. If the regex tester returns one match where you expected many, the cause is almost always the g (global) checkbox, which is on by default but easy to clear. The tool uses the ECMAScript engine inside your own browser, so the answer is exactly what JavaScript would return. It is free, needs no signup, and sends nothing to a server.

I lost forty minutes to this last Tuesday. A log file held roughly forty phone numbers. My pattern was \d{3}-\d{4} and the tool reported one match. The pattern was right. The checkbox was not. This is a debugging notebook about the fields that actually change the result, written in the order I now check them.

Why did the regex tester stop after the first match?

A regular expression, usually shortened to regex, is a compact description of a set of strings. The engine walks the input left to right and tries the pattern at each position. At the first position where the pattern succeeds it records the matched substring and its zero-based start and end indices.

With g set, the next search begins at the end of that match. Without g, the scan stops after one match. That is the whole bug. A regex tester with match highlighting makes the difference visible: the MATCH SUMMARY line reads 2 matches, Evaluated with /g on 77 characters when g is on, and a single match when it is off.

What do the five flag checkboxes actually change?

Regex tester workflow from pattern and five flags through the ECMAScript engine to highlighted matches and a capture group table

Below the pattern input sit five labelled checkboxes: g global, i ignore case, m multiline, s dot all and u Unicode. Only g is checked on load. The regex tester exposes exactly these five because they are the ones supported by ECMAScript RegExp.

Flag Name Effect on a regex tester result
g global Return all non-overlapping matches instead of only the first, and replace all occurrences.
i ignoreCase Match letters without regard to case.
m multiline Make ^ and $ match at line boundaries instead of only string boundaries.
s dotAll Let . also match newline characters.
u unicode Treat the pattern as Unicode code points and enable escapes such as \p{Letter}.

How do I read the highlighted test string and the match table?

On load the pattern field holds (\w+)@(\w+)\.(\w{2,}), its placeholder reads e.g. \d{3}-\d{4}, and the Test string textarea holds a line about contacting [email protected] or [email protected]. Press 1. Test and highlight. Here is the exact sequence I follow.

  1. Type the pattern in Regular expression pattern. It is a text input with id rx-pattern. Omit the leading and trailing slashes; the flags live in the checkboxes.
  2. Set the five flags. Confirm g is checked. Add i for case-insensitive work, m for line anchors, s for newlines, u for Unicode code points.
  3. Paste the sample into Test string. It is a textarea with id rx-text. HTML in the text is escaped before display, so markup cannot break the page.
  4. Press 1. Test and highlight. Read the MATCH SUMMARY card first, then the Highlighted test string, where every match is wrapped in a marker.
  5. Open Match table with capture groups. The columns are #, Start, End, Match and Capture groups. For the default text the regex tester shows 1 / 8 / 23 / [email protected] / [1] ada [2] example [3] com and 2 / 27 / 41 / [email protected] / [1] grace [2] work [3] org.
  6. Export if needed. Copy regex literal, Copy matches as CSV and Copy replace result each write to the clipboard. Nothing is uploaded.

Indices are zero based and measured in UTF-16 code units, exactly as returned by JavaScript RegExp.exec(). Capture group k is the substring covered by the k-th pair of parentheses, or undefined when that group did not participate.

How do I preview a regex replace with $1 and <name>?

Table of five ECMAScript regex flags global ignore case multiline dot all and Unicode with the effect each one changes

Press 2. Replace preview. The Replacement string field, labelled use $1, $2 or $<name>, defaults to $1 at $2. Parentheses do two jobs: they group tokens so a quantifier applies to all of them, and they capture the matched text. (?:...) groups without capturing, and (?<year>\d{4}) gives a group a name.

Inside a replacement string, $1 refers to the first group, $<year> to a named group, $& to the whole match and $$ to a literal dollar sign. The worked example in the tool swaps Doe,Jane with (\w+),(\w+) and a replacement of $2 $1 to give Jane Doe. Press Copy replace result to take the finished text away.

Which preset should I start from when the pattern is new?

Five preset buttons sit above the results: Email pattern, Phone pattern, ISO date pattern, Hex colour pattern and Repeated word pattern. Press one to load a known-good pattern and test text. The 3. Pattern explainer button then walks the pattern token by token, and the Regex syntax cheat sheet below lists plain-text rows you can copy into code.

Four mistakes that keep costing me an hour

  • Clearing g by accident. One match, and a replacement that touches only the first occurrence. Check the checkbox first.
  • Using . across lines. The dot stops at a newline by default. Use s or [\s\S].
  • Forgetting to escape a literal dot. example.com also matches exampleXcom. Write example\.com.
  • Trusting a shape as a value. \d{2} happily matches 99 as a month. Validate ranges in code.

Where this fits in a NimbusCalc workflow

Once matches are extracted, the JSON formatter and validator turns structured output into readable data, and the guide to using a JSON formatter covers that step in detail. Scheduled extraction jobs are easier to reason about with the cron expression generator. Validation patterns are often paired with a password strength checker guide rather than used alone. Two guides in this batch use the same left-to-right, index-based habit: the unix timestamp converter guide reports indices and boundaries for an instant, and the number base converter guide reports digit positions by index.

Questions I get asked about this regex tester

Which regex flavor does the regex tester use? The ECMAScript RegExp engine built into your browser, as specified in ECMA-262, so results match JavaScript and TypeScript code.

What does the g flag do? It makes the search global, so every non-overlapping match is returned instead of only the first one.

How do I capture part of a match? Wrap the part in parentheses to create a capture group, then refer to it as $1 in a replacement or read it from the groups list in the results table.

What is the difference between greedy and lazy quantifiers? A greedy quantifier such as .* takes the longest possible match; adding a question mark to make .*? takes the shortest possible match.

Is a regex tester private enough for production log lines? Yes. All matching runs locally in your browser and nothing is stored or transmitted until you click a copy button.