Developer utility
Regex Playground
Test regular expressions and pattern matching locally against your sample text. A Regular Expression (regex) is a sequence of characters that specifies a search pattern in text.
Your input stays in the browser — nothing is sent to a server. Privacy policy.
Best for
- Developers building and debugging regex patterns.
- Content teams validating structured text rules.
- Anyone learning regular expressions by testing live.
When to use
- You need instant feedback while refining a pattern.
- You want to verify capture groups and match behavior.
- You are testing examples before using regex in code.
Pattern
Write your regex
Type a pattern, toggle flags, then paste text to match against.
Test input
Paste your text
Every match is highlighted in the output panel.
Matches
Highlighted output
Try this example
Extract status codes from a log line.
Action: Paste the log text below and use the pattern \[(\d3)\] to capture the error codes.
Messy input
2026-05-27 INFO [200] User logged in
2026-05-27 WARN [401] Unauthorized access
2026-05-27 ERROR [500] Database timeout
What it reveals
The pattern matches the brackets but captures only the 3-digit status code. The playground highlights the full match and extracts "200", "401", and "500" into separate capture groups so you can verify your logic.
Do not rely on this for: Execution performance testing. It helps you verify match logic, but cannot tell you if a pattern will cause catastrophic backtracking in production.
FAQ
What regex flags should I start with?
Start with global (g) for multiple matches, then add case-insensitive (i) or multiline (m) only when needed.
Why does a pattern match in one tool but not in another?
Different engines can vary. This playground is useful for fast iteration before moving patterns into your runtime environment.
Can I inspect match positions?
Yes. The matches list shows each matched value with its index so you can verify pattern behavior precisely.
Found an issue or have a suggestion? Report an issue or suggest an improvement.