Loading tool…
Write a regular expression and test it against sample text in real time. See every match, its position and any capture groups instantly.
Loading tool…
Regex Tester is a free, private online tool that lets you test a regular expression against sample text with live matches, flags and capture groups. It runs entirely in your browser, so nothing you enter is uploaded to a server.
g or i); or pick a ready-made one from Common patterns.Privacy: this tool runs entirely in your browser. Your input is never sent to, received by, or stored on any server — there are no uploads and no tracking of what you enter.
Enter a pattern and flags, then paste text to test. Matches are listed as you type, including the matched substring, its index and the contents of each capture group.
Use flags like g (global, find all matches), i (case-insensitive), m (multiline) and s (dotall). This tool uses the JavaScript regex engine.
Parentheses create capture groups. The tester shows each group's value per match, which is invaluable for extracting structured data from text.
A regex (regular expression) tester lets you build and check a pattern against sample text and see the matches highlighted live as you type. Regular expressions are a compact, powerful mini-language for finding, validating, extracting and replacing text patterns, and a tester is the fastest way to get one right without trial-and-error in code.
A regex describes a pattern rather than a fixed string - 'one or more digits', 'an email-shaped token', 'a word at the start of a line'. They power search-and-replace, form validation (emails, phone numbers, postcodes), log parsing, data extraction and find-in-files across virtually every programming language and text editor.
This tester offers three modes. Match lists every match with its position and capture groups. Replace previews a substitution using replacement patterns like $1 for captured groups. Split shows the pieces you get when the text is broken apart on the pattern. Together they cover the three things you most often do with a regex.
Flags change behaviour - g finds all matches, i ignores case, m works line-by-line, s lets the dot match newlines. Capture groups in parentheses pull out parts of each match. The built-in common-patterns library and cheat sheet give you tested starting points (email, URL, IPv4, date, hex color) and a quick syntax reference.
Enter your pattern and flags, paste test text, and matches appear instantly; switch modes to test replacing or splitting. It uses the JavaScript regex engine - the same one in browsers and Node.js. Everything runs locally, so you can safely test patterns against real, sensitive data without it leaving your browser.