Test a JavaScript regex
Enter a pattern without surrounding slashes, choose flags and test it against sample text.
JavaScript regex pattern only. Do not include surrounding slash delimiters.
Flags
Processed in your browser. Keep private logs and secrets out of browser tools unless you trust this device.
Match limit
Stop after 1 to 1,000 matches.
Privacy notes
Patterns and test text are processed in this browser tab. NoNoiseTools does not need to upload regex input for this tool.
Avoid pasting secrets, tokens, production logs or private customer data unless you trust this device.
How this regex tester works
The tester builds a JavaScript RegExp in the browser, runs it against the sample text and lists matches. If the global flag is not selected, the tool adds it internally so all matches can be shown.
JavaScript regex flags
Supported flags include global, case-insensitive, multiline, dotAll, Unicode and sticky matching. The match indices flag is offered only when the browser supports it.
Performance and safety notes
Some regular expressions can be expensive. This tester uses a match limit, text-size limits, action-based testing and a conservative nested-quantifier guard, but it cannot prove every possible pattern is safe.
Privacy notes
Regex patterns and sample text are processed in the browser. NoNoiseTools does not need to upload pasted regex input to a server for this tool.
Avoid pasting API keys, passwords, tokens, production logs or private customer data unless you understand browser-side tools and trust this device.
What this tool does not include
It does not test PCRE, Python or Ruby regex semantics, run server-side regex, save pattern history, guarantee ReDoS safety or provide replacement workflows in this version.
Key terms and assumptionsShort notes about JavaScript regex behaviour, flags, capture groups, limits and browser-side testing.
- JavaScript engine
- The browser RegExp engine is used, so syntax and features can differ from other languages.
- Action-based testing
- Regexes run only when the Test regex button is pressed, not on every keystroke.
- Size and match caps
- Pattern length, test text size and match count are capped to keep the page responsive.
- Heuristic safety guard
- Nested quantifier patterns are blocked, but this does not guarantee every possible regex is safe.
- Escaped rendering
- Highlights and match tables render text as escaped React text rather than user-provided HTML.
Related tools
Browse the Developer tools hub for more browser-based developer utilities.
- JSON Formatter Format, validate and minify standard JSON in your browser with 2-space or 4-space indentation and copyable output.
- URL Encoder / Decoder Encode URL components or decode percent-encoded text in your browser, with optional plus-space handling.
- Base64 Encoder / Decoder Encode text to Base64 or decode Base64 back to UTF-8 text in your browser with clear invalid-input messages.
- Markdown Table Generator Create a Markdown table from rows, columns or simple pasted CSV-like text in your browser, then copy the output.
- Text Cleaner Clean pasted text by trimming whitespace, removing extra spaces, removing blank lines and normalising line breaks.
- Line Counter Count total lines, non-empty lines and blank lines in pasted text.
- Character Counter Count characters with spaces, characters without spaces, words and lines from pasted text.
- Remove Duplicate Lines Remove duplicate lines from pasted text while keeping the first occurrence.
FAQs
Which regex engine does this use?
This version uses the browser's JavaScript regular expression engine.
Are my pattern and test text uploaded?
No. Testing happens in your browser.
Why does my regex work differently from another language?
Regex features differ across JavaScript, PCRE, Python, Ruby and other engines. This tool tests JavaScript regex.
What happens if the regex is invalid?
The tool shows a clear syntax error and does not keep stale matches.
Can a regex freeze the page?
Some patterns can be expensive. This version uses input limits, match limits and a conservative nested-quantifier guard, but it cannot prove every pattern is safe.
Does this support replacement?
Not in this version. Replacement workflows should be separate scope.
Are capture groups shown?
Yes. Numbered and named groups are shown where browser support allows.