Regex Tester - Test Regular Expressions Online
Free online regex tester. Test JavaScript regular expressions, find matches and debug patterns instantly in your browser.
More Tools
What is Regex?
A regular expression (regex or regexp) is a sequence of characters that defines a search pattern. Regex is used for pattern matching within strings. Regular expressions are supported by virtually all programming languages and text editors.
How Regular Expressions Work
A regex engine processes a pattern character by character against a target string. Special characters called metacharacters have special meanings that define the matching rules. The engine tries to find matches from each position in the string.
Regex Examples
Email Address
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}Contact us at support@utilforge.dev or info@example.comURL
https?://[^\s/$.?#].[^\s]*Visit https://utilforge.dev or http://localhost:3000 for morePassword Strength
^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$Password123
weak
Test1234Common Regex Patterns
| Pattern | Regex |
|---|---|
| Digits only | ^\d+$ |
| Letters only | ^[a-zA-Z]+$ |
| Alphanumeric | ^[a-zA-Z0-9]+$ |
| Hex Color | ^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$ |
How to Use Regex Tester
- 1
Enter your regular expression pattern in the top input field
- 2
Paste or type the text you want to test in the bottom input area
- 3
Click Test to see all matches with positions and captured groups
- 4
Use flag toggles to enable global, case-insensitive, multiline, or dot-all matching
Frequently Asked Questions
What regex syntax does this tool support?
This tool supports JavaScript regular expression syntax, based on the ECMAScript standard. It supports all standard regex features including character classes, quantifiers, groups, lookaheads, and backreferences.
Is my data sent to a server when testing regex?
No. All regex testing happens entirely in your browser using JavaScript's built-in RegExp engine. Your patterns and test data never leave your device.
What do the regex flags g, i, m, and s do?
g (global) finds all matches. i (ignore case) makes the pattern case-insensitive. m (multiline) matches per-line boundaries. s (dotall) makes dot match newline characters.
Why does my regex work differently in JavaScript vs another language?
While most regex features are universal, each programming language has its own regex flavor with slightly different syntax. Check your target language's regex documentation for specific differences.