Check extraction before integration
Try representative lines and inspect starting positions. Testing does not perform replacement or register a rule in your project.
Evaluate a regular expression against text, adjust its flags, and inspect the matches to refine your pattern more easily.
Test a JavaScript regular expression against text and inspect full matches with their starting positions. Pattern and flags are entered separately to distinguish expression syntax from a code literal. Evaluation stays in your browser inside a separate Worker, with a two-second budget and a 10,000-match limit. Expensive searches can therefore be stopped without blocking the main interface.
The pattern is passed to the browser’s RegExp constructor. Enter \d+ directly, without /.../ literal delimiters or doubled string-literal escaping. Flags such as i, m, s and u follow JavaScript support in your browser. Unknown, repeated or incompatible flags produce an error.
The tester collects matches globally and adds g when omitted. The y flag still means sticky matching at the current position rather than unrestricted searching. Results contain full matches; capture groups are not displayed separately in this interface.
Each output line contains a result number, matched text and a bracketed starting index. Indices begin at zero and count JavaScript UTF-16 units. With u, an emoji may be one match while occupying two units in string indices. Positions therefore do not universally count visual characters.
The Worker is terminated when the two-second budget expires. Startup is included, so a timeout alone does not prove invalid syntax. Output is capped at 10,000 matches with an explicit truncation notice. Editing text, pattern or flags invalidates previous output; resetting stops the current task.
Put the expression in its field and flag letters separately. Source text belongs in the larger test field rather than the pattern.
Start small and inspect values and indices. On timeout, simplify alternatives or quantifiers before retrying reduced input.
Copy or download match text and write tests in the eventual execution environment. The exported file is not a replacement program.
Try representative lines and inspect starting positions. Testing does not perform replacement or register a rule in your project.
Observe i for case handling or m for line anchors. Do not assume the same behavior in PCRE or SQL engines.
Use supplementary characters to distinguish matched text from JavaScript indices when selecting substrings in code.
Ada with g matches both words. The first starts at 0 and the second at 8 in Ada and Ada.
Input
{
"pattern": "Ada",
"flags": "g",
"text": "Ada and Ada"
}Result
1. Ada [0]
2. Ada [8]With . and gu, 😀 is one complete match starting at 1. B starts at 3 because the emoji occupies two UTF-16 units.
Input
{
"pattern": ".",
"flags": "gu",
"text": "A😀B"
}Result
1. A [0]
2. 😀 [1]
3. B [3]No. Enter mypattern as the expression and g as flags. Slashes are not automatically removed as JavaScript literal delimiters.
The tester adds g to collect occurrences. It displays a list rather than reproducing one non-global exec call.
Output contains full matched text and starting indices. Capture groups and their names are not separately exposed in this version.
It exceeded the two-second budget. Some quantifier combinations cause extensive backtracking. Reduce input and simplify the pattern; stopping the Worker keeps the interface usable.
No. Syntax and flags come from JavaScript RegExp in your browser. Other engines may differ in supported constructs, indices and Unicode behavior.
Related tools
Tools similar or complementary to this one.
Replace a text fragment in a pasted or imported document.
Format JavaScript, TypeScript or JSX for easier reading without executing code. Processing runs locally in your browser.
Query JSON data with a simple JSONPath expression.
Understand ISO 8601 week numbers, Unix timestamps in seconds or milliseconds, and the difference between human-readable dates and technical time values.