Regex Tester | Free Online Regular Expression Checker
Test regular expressions with live matches and JavaScript regex flags. 100% free, works in browser — no data sent to server.
Online regex tester tool
Test Text
Matches: 2
Regular Expression (Regex) Cheat Sheet & Common Patterns
Regular expressions provide a concise syntax to find, match, and validate patterns in text. Below are the most widely used token symbols and production regex patterns.
Common Production Patterns
// Email: ^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$
// Phone: ^\+?[1-9]\d{1,14}$ (E.164 format)
// URL: ^https?:\/\/[^\s/$.?#].[^\s]*$
// Hex: ^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$
// UUID: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$Character Classes & Anchors
// \d Matches any digit [0-9]
// \w Matches any word character [a-zA-Z0-9_]
// \s Matches any whitespace (space, tab, newline)
// \b Matches a word boundary
// ^ Matches start of string (or line with m flag)
// $ Matches end of string (or line with m flag)Quantifiers
Control how many times a character or group must repeat:
// * 0 or more times (greedy)
// + 1 or more times (greedy)
// ? 0 or 1 time (optional)
// {n} Exactly n times
// {n,m} Between n and m timesJavaScript Flags Explained
Flags modify how pattern matching behaves across strings:
// g (global): Find all matches, don't stop after first
// i (ignoreCase): Case-insensitive matching (A equals a)
// m (multiline): ^ and $ match start and end of each line
// s (dotAll): Allows . to match newline characters tooFrequently Asked Questions
How do I test a regular expression online?
Enter your regex pattern and the test text into our Regex Tester. Matches are found instantly in your browser using the JavaScript RegExp engine, with no data ever leaving your device.
What regex flags are supported?
Our tester supports all standard JavaScript regex flags: g (global), i (case-insensitive), m (multiline), s (dotAll), u (unicode), v (unicodeSets), y (sticky), and d (indices). Invalid flags are removed automatically.
Can I use capture groups in the regex tester?
Yes. The tester uses JavaScript's RegExp.exec() method, which supports capture groups, named groups, and lookaheads. All matches including group captures are returned for each match found.
Why does my regex cause an infinite loop?
A zero-length match inside a global regex loop can cause infinite iteration. Our tester automatically advances lastIndex when a zero-length match is detected, preventing hangs in the browser.