Processing runs on your device in your browser. Review the output before using it.
Regex Tester
Test regular expressions.
What this tool does
Test a JavaScript regular expression against a short text sample and inspect matching strings with their indexes. This is useful when exploring a search pattern before placing it into a script, validation rule or text-processing workflow.
How to use Regex Tester
Enter the pattern without surrounding slash delimiters, paste sample text and choose Run tool. The tool uses global matching and returns up to one hundred matches. Include examples that should match and examples that should remain unmatched.
Example and interpretation
The pattern [0-9]+ finds runs of digits in a sentence. Match indexes describe positions in the JavaScript string, not visual columns in a document. A pattern that can match an empty string may produce surprising empty results between characters.
Limits and practical tips
Complex expressions can take a long time on particular inputs. Processing is isolated in a worker with a timeout so a problematic test can be stopped. Matching behaviour follows JavaScript syntax and can differ from Python, PCRE, a database engine or an online form validator.
Using the result in a project
Start with a small, non-sensitive example and compare the result with the format expected by the receiving application. A successful transformation shows that this operation ran; it does not prove that the result is valid for every API, database field or application rule. Check the destination documentation before using generated data in a live workflow.
Before you finish
The inputs are handled by browser JavaScript for this tool. Do not paste production credentials, customer records or private configuration merely to test a format. Keep a reproducible sample with harmless values instead. If an error appears, reduce the sample until the problematic portion is clear, then correct the source and run the operation again. When copying the output, include the complete value and avoid adding surrounding quotation marks unless the destination specifically requires them. A copied newline or omitted closing character can change how another application reads an otherwise correct result.
Explore all tools, read our privacy information or report a problem.
Questions and answers
Should I enter slash delimiters around the pattern?
No. Enter the pattern itself, such as [0-9]+. The tool constructs a JavaScript regular expression and applies global matching.
Why does a valid-looking expression time out?
Some patterns require excessive work for particular inputs. The tool runs matching in a worker and stops an overlong test. Reduce the input or simplify the expression.
Why does the result differ from another regex engine?
Syntax and matching behaviour vary between engines. This page uses JavaScript regular expressions, so confirm compatibility with the language or service where the pattern will actually run.
