Regex Tester
Test regular expressions with real-time match highlighting, capture groups, and replacement preview. Runs entirely in your browser.
Quick Reference
Click to insert a pattern
Tokens
.Any char\dDigit\wWord char\sWhitespace\bBoundary^Start$End*0 or more+1 or more?Optional{n}Exactly n()Group[]Char class|Alternation100% Client-Side Processing
All regex matching is performed entirely in your browser using JavaScript's native RegExp engine. Your data is never sent to any server.
More Free Developer Tools
Explore the full OGPix toolkit — all free, all client-side.
Browse All Tools →What Is a Regular Expression?
A regular expression (regex or regexp) is a sequence of characters that defines a search pattern. Regular expressions are used in programming, text editors, and command-line tools to search, match, and manipulate text. They are supported in virtually every programming language including JavaScript, Python, Java, Go, PHP, and Ruby.
Common use cases include validating input formats (email addresses, phone numbers, dates), extracting data from structured text, find-and-replace operations, and parsing log files. Mastering regex is an essential skill for developers, data engineers, and system administrators.
How to Use This Regex Tester
Enter your regular expression pattern in the input field at the top. Toggle flags like global (g), case-insensitive (i), multiline (m), dotall (s), and unicode (u) using the buttons. Paste or type the text you want to test in the Test String area.
Matches are highlighted in real-time in the preview section below. The Match Results panel shows every match with its position and any captured groups. Use the Replace field to test substitution patterns using references like $1, $2, or $&.
Frequently Asked Questions
Is my data safe when using this regex tester?
Yes. All pattern matching runs entirely in your browser using JavaScript's native RegExp engine. No data is transmitted to any server. You can verify this by using the tool with your network disconnected.
What regex flavor does this tool use?
This tool uses JavaScript's built-in RegExp engine, which implements the ECMAScript regular expression syntax. This is the same engine used in Node.js and all modern browsers. It supports features like lookahead, lookbehind (in modern browsers), named capture groups, and Unicode property escapes.
What do the different flags mean?
g (global) finds all matches instead of stopping after the first. i (case insensitive) ignores letter casing. m (multiline) makes ^ and $ match the start/end of each line. s (dotall) makes the . character match newline characters. u (unicode) enables full Unicode matching and makes \p{} property escapes available.
How do capture groups work?
Parentheses () in a regex create capture groups. When a match is found, each group captures the text matched by the sub-pattern inside the parentheses. Groups are numbered starting at 1 and can be referenced in replacement strings as $1, $2, etc. The full match is referenced as $&.
Can I test regex for other programming languages here?
This tool uses JavaScript regex syntax, which is very similar to regex in most languages. However, some features like possessive quantifiers, atomic groups, or conditional patterns (available in PCRE/Perl) are not supported. For standard patterns, results will be the same across languages.