Regex Tester
Test JavaScript regular expressions against sample text and inspect matches.
About Regex Tester
Regular expressions are compact patterns for searching and matching text. A tester helps you try a pattern against representative input, select JavaScript flags, and inspect matched values, offsets, and capture groups before adding the expression to code.
Patterns run in your browser using JavaScript RegExp. Complex patterns can take a long time on large input, so start with short sample text and avoid testing untrusted expressions in sensitive or shared environments. This tool does not rewrite, explain, or guarantee the performance of a pattern.
How to use this tool
Enter a pattern without slash delimiters, choose supported JavaScript flags, and provide test text. Global or sticky mode lists multiple matches, up to a safe display limit.
Frequently asked questions
Which regex flavor is supported?
Patterns use the regular expression syntax implemented by the browser’s JavaScript engine, including JavaScript flags such as g, i, m, s, u, and y.
Why do I see only one match?
Without the global or sticky flag, JavaScript returns only the first matching result. Enable g to find successive matches across the test text.
Can a regular expression be slow?
Yes. Some patterns can exhibit excessive backtracking on certain inputs. Keep test strings small, use careful patterns, and consider time limits in applications that accept user-defined expressions.
Related Tools
JSON Formatter
Format, validate, and minify JSON data with syntax highlighting and error detection.
JWT Decoder
Decode and inspect JSON Web Tokens. View header, payload, and expiration info.
UUID Generator
Generate cryptographically secure UUID v4 values. Single or bulk generation.