Regex Tester
Test a regular expression against sample text and inspect matches.
Your result will appear here…
How to use Regex Tester
- Enter a JavaScript pattern without surrounding / delimiters and choose flags.
- Paste test text and select Test.
- Review matches against both expected and unexpected input.
Example
Input / settings:
Pattern: \d+ Flags: g Text: Order 42, retry 7
Output:
Matches: 2 42 (index 6) 7 (index 16)
When to use
- Extract numeric fragments from a log.
- Debug case-insensitive matching.
- Check a pattern before using it in JavaScript.
Overview
Regular expressions describe text patterns. This tester uses JavaScript RegExp and reports matching text with its index, helping you inspect actual matches instead of guessing from the pattern.
Supported input
pattern, flags, and text
Output details
match results
Common mistakes
- Other regex dialects may use different syntax.
- A dot does not match line breaks unless the s flag is used.
- Nested repetitions can cause excessive backtracking even on short input.
Practical tips
- The tester searches globally even when you omit g; production match behavior can differ.
- Text is limited to 5,000 characters, patterns to 250, and displayed matches to 100. These limits do not guarantee protection from expensive patterns.
Privacy and security
This tool runs entirely in your browser. Your input is never uploaded to our servers. Matching happens locally. Avoid testing untrusted patterns against sensitive or large text; an expensive pattern can block the browser.
Frequently asked questions
Does this use Python or PCRE syntax?
No. It uses the JavaScript regex engine in your browser.
What do match indices count?
JavaScript string offsets are UTF-16 code units, which can differ from visible-character counts.
Why are several matches shown without g?
The tester adds global matching for its report. Do not assume a single-match application API behaves the same way.