ToolsArena24

Regex Tester

Maintained by the ToolsArena24 team. Methodology and test scope

Quick answer: Test a JavaScript regular expression against sample text and inspect each match, its zero-based index and captured groups. The pattern and flags are separate fields; omit the slash delimiters used in JavaScript source code.

About this regex tester

Test a JavaScript regular expression against sample text and inspect each match, its zero-based index and captured groups. The pattern and flags are separate fields; omit the slash delimiters used in JavaScript source code.

The g flag finds multiple matches; without it, only the first is listed. Matching runs inside a disposable worker with a one-second limit so a pathological pattern cannot freeze the page indefinitely. Empty matches advance safely.

Patterns follow your browser’s JavaScript engine rather than PCRE or Python syntax. Text is limited to ten thousand characters, the pattern to five hundred, and results to one thousand matches. Indices measure UTF-16 code units, not displayed graphemes.

Using Regex Tester starts with the JavaScript pattern and Flags and Test text controls. Pattern \d+ with flag g finds 12 and 34 in a12 b34. The second match starts at index 5. Select Test pattern to update the result below the controls. Read the output together with the regex tester limitations described here before using it in a document, project or decision. Change one input at a time when comparing alternatives so that you can identify which change affected the result.

Which controls should I check first?

The Regex Tester form labels its controls as JavaScript pattern; Flags; Test text; Result. Use those labels to keep the source and settings separate. A sample argument that selects a mode is not additional source text. Choose the setting matching your intended operation before copying a result, and change it explicitly when comparing another mode. The labels describe what this form accepts; the worked examples below demonstrate only the stated supplied values.

How should I interpret this specific operation?

Flags change the search rule. Global mode finds subsequent matches; without it only the first match is returned. The helper advances after an empty match so that it cannot loop at the same position. The browser worker has a time limit for actual matching. A pure sample verifies match positions but does not prove that every complex expression will finish within the worker's limit.

Worked helper values

These values come from the reproducible calculation examples supplied with this tool. Each row identifies the complete supplied arguments and the returned value. A visible ↵ denotes a line break and ⇥ denotes a tab in text examples. Settings appear alongside source data so that a different mode is not mistaken for an identical input. These are helper calculations, not observations of a live device, fetched target, image decoder, browser preview or downloaded file. Use the stated method above to relate the returned fields to the actual operation.

Supplied valuesCalculated return value
\d+; g; a12 b34[{"match": "12", "index": 1, "groups": []}, {"match": "34", "index": 5, "groups": []}]
^; g; abc[{"match": "", "index": 0, "groups": []}]

Which inputs control this result?

Read the labels and units before entering a number. A dimension, a density, a percentage and a scale factor can all accept decimals while representing different quantities. Use the operation selected by the form instead of assuming that every ratio has the same denominator. Keep the source values beside the result so that another calculation can be checked independently. If a number came from a rounded measurement, extra output digits are arithmetic precision rather than newly measured information. Change one input at a time when comparing alternatives so that you can see which assumption caused the difference.

How can I check the order of magnitude?

Estimate the result with simple rounded values before relying on the detailed answer. A value that doubles when only a proportional numerator doubles is consistent with division or multiplication; a ratio can move in the opposite direction when its denominator doubles. For percentages, distinguish a fraction of a total from a relative change in that total. For image dimensions, distinguish shape from physical size and pixel density. These comparisons catch a misplaced decimal or a swapped field more effectively than judging whether the output has enough decimal places. Then check the worked sample using the exact stated inputs.

Why does the unit need to stay with the number?

A numerical answer without its unit or operation can be misleading. Pixels and inches are not interchangeable, and a percentage change is different from a percentage-point difference. A coordinate ratio describes shape, not the number of pixels or the quality of an image. Keep the complete result label when copying into notes or a spreadsheet. If another system expects a unitless proportion rather than a percent, convert that representation deliberately. Do not append a preferred unit to an unchanged number. The formula applies to the supplied interpretation of each field, not to any arbitrary label added later.

How do I use regex tester?

Pattern \d+ with flag g finds 12 and 34 in a12 b34. The second match starts at index 5.

What does regex tester support?

The g flag finds multiple matches; without it, only the first is listed. Matching runs inside a disposable worker with a one-second limit so a pathological pattern cannot freeze the page indefinitely. Empty matches advance safely.

What are the limits of regex tester?

Patterns follow your browser’s JavaScript engine rather than PCRE or Python syntax. Text is limited to ten thousand characters, the pattern to five hundred, and results to one thousand matches. Indices measure UTF-16 code units, not displayed graphemes.