Regex Tester guide
Test JavaScript regular expressions against sample text, inspect match positions, and review captured groups without sending the text to a server.
What this tool does
The Regex Tester evaluates a pattern using the browser's JavaScript regular-expression engine. It supports the g, i, m, s, u, and y flags. Results show each matched value, its zero-based character index, and any numbered capture groups. With the global or sticky flag enabled, the tester collects repeated matches up to a display limit of 1,000; without either flag, it returns the first match just as JavaScript RegExp.exec() does.
Evaluation runs inside a separate Web Worker. If the expression does not finish within one second, ToolSeta terminates that worker and reports the timeout. This protection reduces the chance that catastrophic backtracking will freeze the page, but it does not prove that a pattern is safe for production. Real services can receive longer or adversarial input and have different runtimes, limits, and regex engines.
Regular-expression syntax differs across JavaScript, Python, Java, PHP, .NET, RE2, and database products. A pattern that succeeds here should be considered a JavaScript result unless you verify it in the target environment.
How to use it
- Enter the pattern without surrounding slash delimiters.
- Enable only the flags your application will use.
- Paste representative test text, including expected failures and edge cases.
- Select Test expression.
- Review match indexes, values, capture groups, errors, or the timeout message.
Test both ordinary and unusually long inputs before deploying a pattern. For validation, anchor the pattern where appropriate and remember that matching a substring is different from validating the entire value.
Benefits
- Uses the native JavaScript regex engine
- Shows exact match positions and capture groups
- Supports six commonly used JavaScript flags
- Stops long-running evaluation after one second
- Caps output to keep large result sets manageable
- Processes patterns and text locally
Limitations and safe use
The tester does not perform replacement, visualize backtracking, benchmark across engines, or certify protection from regular-expression denial of service. The timeout is a browser-side safety boundary for this page, not a security guarantee for copied code. Avoid pasting credentials, private keys, or personal records even into local utilities when unnecessary, because sensitive text can still remain in clipboard history or screenshots.