RegEx Tester
Test and debug regular expressions instantly with live match highlighting and capture group inspection.
Use this free online regex tester to test and debug JavaScript regular expressions in real time. Highlight matches, inspect capture groups, and experiment with regex flags instantly. Whether you're validating input, parsing logs, extracting data, or building search patterns, this tool provides immediate visual feedback without sending data to a server.
About this tool
What is a Regular Expression?
A regular expression (regex) is a sequence of characters that defines a search pattern used to match text. Developers commonly use regex for input validation, log parsing, data extraction, and search operations. If you're extracting structured data like JSON from logs or API responses, you can format it afterwards using our JSON Formatter to make the structure easier to inspect.
- Validate email addresses and user input
- Extract structured data from text
- Search and replace text patterns
- Parse logs and large datasets
Test Regular Expressions Live
Test and validate regular expression patterns with live match highlighting and detailed match lists.
- Supports common regex flags (g, i, m, s, u, y)
- Shows individual capture groups
- Inline match highlighting for easier debugging
- Error reporting for invalid regex syntax
- Works entirely in your browser with no server processing.
Debug Patterns Faster
Use the match list to confirm your pattern and flags before deploying it in code.
- Verify greedy vs. lazy quantifiers
- Test multiline anchors (^ and $)
- Identify unexpected overlapping matches
How to Use RegEx Tester
Enter Your Regex Pattern
Type your regex pattern in the top input. Toggle flags like 'Global' (g) or 'Case Insensitive' (i) using the buttons.
Add Text to Test Against
Paste the text you want to test against in the large text area below.
Inspect Regex Matches and Groups
Highlighted matches appear instantly in the text. Check the sidebar (or bottom on mobile) for a detailed list of match groups and indices.
Common questions
What is a regular expression?
A regular expression (regex) is a pattern used to match, search, and manipulate text. It is commonly used for input validation, parsing, and text processing in programming languages.
What is a regex tester?
A regex tester allows developers to experiment with regular expressions by entering a pattern and testing it against sample text. It highlights matches and capture groups to help debug regex patterns quickly.
How do I test a regular expression?
Enter your regex pattern, paste the text you want to test, and adjust flags like global (g) or case-insensitive (i). A regex tester will highlight matches instantly so you can verify your pattern works correctly.
Which regex flavor is used?
It uses the browser's built-in JavaScript (ECMAScript) regex engine. This is fully compatible with Node.js and modern frontend frameworks.
Does this support PCRE or Python regex?
This tool uses the browser's JavaScript (ECMAScript) regex engine. Features specific to PCRE, Python, or other regex engines may not be supported.
Does it support Lookbehind?
Yes, positive and negative lookbehind `(?<=...)` is supported in all modern browsers (Chrome, Edge, Firefox, Safari).
Why does my pattern match everything?
Patterns like `.*` can match large portions of text because `.` matches any character and `*` allows unlimited repetition. Consider using more specific character classes or lazy quantifiers like `.*?`. If you're validating encoded strings such as Base64 tokens, you can inspect them further using our Base64 Encoder / Decoder.
How do I match newlines?
Enable the 'Multiline' (m) flag to make `^` and `$` match start/end of lines, or use the 'Dot All' (s) flag to make `.` match newline characters.
Is my data saved?
No. Your patterns and test text remain locally in your browser and are not sent to any backend.
Related tools
Case Converter
Convert text between camelCase, snake_case, PascalCase, kebab-case, uppercase, and lowercase instantly.
Duplicate Line Remover
Instantly remove duplicate lines from lists or text. Advanced options for case-sensitivity, whitespace trimming, and ignoring empty lines. 100% secure.