Regex Tester
Test regular expressions in real-time. See highlighted matches, named capture groups, exact character indexes, and test replacement strings with JavaScript flavors.
Pattern & Test String
Matches (0)
No matches found...
Highlighted
Nothing to highlightReplace
About this tool
The Regex Tester allows you to write and debug regular expressions in real-time. It shows you exact matches, capture groups, and character indices as you type, making it easier to build complex validation rules.
How to use it
- Enter your regex pattern.
- Toggle flags like global (g) or case-insensitive (i).
- Paste a test string to see the matches highlighted.
Examples
Testing an email regex
\b\w+@\w+\.\w+\b
Match found: test@example.com
Limits and notes
- Uses JavaScript (ECMAScript) regex syntax.
- Catastrophic backtracking can occur with poorly written patterns.
Frequently asked questions
- What flags are supported?
- g, i, m, s, u, and y.
- Does it support lookaheads?
- Yes, standard JS lookaheads and lookbehinds are supported.
Want the details? Read the full guide: Debugging a Regex That Works in Your Head.
Related Tools
UUID GeneratorGenerate cryptographically secure Version 4 (v4) UUIDs. Create batches of up to 100 unique identifiers at once, perfect for database primary keys or test data.
Cron GeneratorExplain cron expressions in plain English and predict the next 5 run times. Validate syntax for Linux crontab or serverless schedulers before deploying jobs.
Timestamp ConverterConvert Unix timestamps to human-readable dates and vice versa. Includes a live clock and automatically handles seconds or milliseconds for easy debugging.
Timestamp BatchConvert a whole list of Unix timestamps or dates at once. The unit is detected per line, so mixed seconds and milliseconds are handled together.
Mock Data GeneratorGenerate JSON test fixtures from a short schema. Describe the fields and get deterministic rows back, so a failing test reproduces from the same seed.
JSON ValidatorValidate JSON syntax with detailed error messages. Catch trailing commas, missing brackets, and syntax errors instantly before sending payloads to your API.
JSON FormatterBeautify, validate, minify, and view JSON. Format messy API responses into readable code or compress it to save bandwidth, running safely in your browser.
JSON MinifierCompress JSON to a single line. Remove all unnecessary whitespace and line breaks to reduce payload size for production APIs without altering the underlying data.