Regex Tester
Test and debug regular expressions against a test string, listing each match with its index, capture groups, and an optional replacement preview. Supports the global, case-insensitive, multiline, dotall, unicode, and sticky flags, re-running on each keystroke behind a 500-millisecond debounce. Named groups display alongside positional ones, and invalid patterns surface the native RegExp error message.
This tool sends nothing over the network. Everything you enter is processed on your device and never reaches our servers.
Documentation
A regex tester evaluates a regular expression pattern against a test string and reports every match, its captured groups, and an optional replacement result. Patterns run through the browser's native RegExp engine, so behavior matches JavaScript regular expressions exactly, and re-evaluation happens automatically as the pattern or flags change, after a 500-millisecond debounce.
A pattern is entered without delimiters or flags; (\w+)@(\w+)\.(\w+) matches email-like strings, for example. The test string accepts multi-line input, so a pattern can be checked against a paragraph or an entire log file rather than a single line.
Global finds every match in the string rather than stopping at the first one. Case-insensitive ignores letter casing. Multiline makes ^ and $ match at line boundaries rather than only at the start and end of the whole string. DotAll lets the dot character match newline characters, which it otherwise skips. Unicode enables full Unicode support for character classes and escapes. Sticky anchors matching at the last index position rather than searching forward from there.
Results report the total number of matches, each match's value, its position index in the test string, and any captured groups. A replacement pattern previews what a substitution would produce, using tokens such as $1 and $2 to reference a captured group and $& to reference the whole match; the substituted output appears in its own section below the match results, so the effect of a replacement pattern is visible before it runs against real data anywhere else.
Regular expressions drive text processing, data validation, and string manipulation across nearly every programming language and platform. Testing a pattern against representative input before it ships catches the edge cases that a hand-written regex tends to miss.
- Web Development: Validate form inputs such as email addresses, phone numbers, and postal codes by testing patterns against sample data before integrating them into client-side or server-side validation logic.
- Data Cleaning: Extract structured information from unstructured text by building capture group patterns that isolate dates, currencies, identifiers, or other tokens from raw data exports.
- Log Analysis: Parse server logs, error messages, and system output by constructing patterns that match timestamps, IP addresses, error codes, and stack trace components across multi-line entries.
- Search and Replace: Preview bulk text transformations before applying them in code editors, build scripts, or database queries by testing replacement patterns with capture group references.
- Education: Learn regular expression syntax interactively by experimenting with patterns and observing how different flags, quantifiers, and grouping constructs affect matching behavior in real time.
- Content Management: Identify and standardize formatting inconsistencies in large documents by testing patterns that detect variations in spacing, punctuation, date formats, or naming conventions.
- API Development: Build and verify URL routing patterns, parameter extraction rules, and request validation expressions used in REST API frameworks and middleware configurations.
- Security Auditing: Test input sanitization patterns to ensure they correctly detect and block potentially malicious strings, SQL injection attempts, or cross-site scripting payloads.
Inputs, outputs, and what the Regex Tester computes
What the Regex Tester asks for and what it returns, as a plain list. Defaults, units, and ranges are the ones the form loads with.
Inputs
- Pattern (text input)
- Replacement Pattern (optional) (text input)
- Enter text to test against
- Global (g) - Find all matches · default: on
- Case Insensitive (i) · default: off
- Multiline (m) - ^ and $ match line boundaries · default: off
- DotAll (s) - Dot matches newlines · default: off
- Unicode (u) - Enable Unicode matching · default: off
- Sticky (y) - Match from lastIndex only · default: off
Controls
Reset