Match all digits
Pattern: \d+
Text: Order 42 ships in 3 days
Flags: g
Matches: "42" and "3" — each run of one or more digits.The Regex Tester lets you build and debug regular expressions against sample text in real time. Enter a pattern and some test input, and the tool highlights every match, shows captured groups, and updates instantly as you edit. This makes it easy to refine a pattern, understand why it does or doesn't match, and experiment with flags like global, case-insensitive, and multiline. It is ideal for crafting validation rules, search-and-replace expressions, and text-extraction patterns without trial-and-error in your code.
A regular expression is a compact, formal language for describing patterns in text. Built from literal characters and metacharacters, regexes let you match, search, and extract structured fragments such as emails, dates, or identifiers. Quantifiers control repetition, character classes define sets of allowed characters, anchors pin matches to positions, and groups capture sub-matches for reuse. Although the basic concepts are universal, exact syntax and supported features vary slightly between engines; this tester uses JavaScript's regular expression flavor.
The main file is the entry point for each run.
Use the Input panel to pipe standard input to your program when it needs data.
Run sends your code to a fresh hosted runtime and streams the result into the output panel.
Your draft stays in this browser, and Share creates a separate snapshot link.
Pattern: \d+
Text: Order 42 ships in 3 days
Flags: g
Matches: "42" and "3" — each run of one or more digits.Pattern: [\w.]+@[\w.]+\.\w+
Text: Contact us at [email protected] today
Matches: "[email protected]".Pattern: (\d{4})-(\d{2})-(\d{2})
Text: Date: 2026-06-14
Match: "2026-06-14"; group 1 = 2026, group 2 = 06, group 3 = 14.Pattern: ^hello
Text: Hello there
Flags: i
Matches: "Hello" — anchored to the start of the line, ignoring case.Pattern: \bcolou?r\b
Text: I prefer color over colour
Flags: g
Matches: "color" and "colour" — the "u" is optional.Pattern: (?<=\$)\d+
Text: price $50 and $100
Flags: g
Matches: "50" and "100" — a lookbehind requires a preceding "$" without including it.Pattern: #[0-9a-fA-F]{6}\b
Text: use #ff0000 and #00FF00
Flags: g
Matches: "#ff0000" and "#00FF00" — exactly six hex digits.Pattern: (\w)\1
Text: balloon committee
Flags: g
Matches: "ll", "oo", "mm", "tt", "ee" — \1 repeats whatever group 1 captured.Pattern: https?://[^\s]+
Text: Go to http://a.com or https://b.org now
Flags: g
Matches: "http://a.com" and "https://b.org" — http or https, then non-space chars.Pattern: \d{1,3}(,\d{3})+
Text: Sum 1,234,567 total
Flags: g
Matches: "1,234,567" — 1-3 leading digits then one or more comma-3-digit groups.The editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.
Enter a pattern, choose flags, and paste test input
Matches highlight live and update instantly as you edit
Captured groups are listed for each match
Toggle flags like global, case-insensitive, and multiline
Inspect numbered and named capture groups
Try replacement expressions for search-and-replace
Matching runs entirely in your browser
Your pattern and test text are never uploaded or stored on a server
Uses JavaScript's regular expression flavor
Ideal for validation rules and text-extraction patterns without code trial-and-error
gGlobal — Find all matchesuUnicode — Unicode sequences(Capturing group[A-Z]Any of: A-Z)End of group\wAny word character (letter, digit, _)+One or more (greedy)gGlobal — Find all matchesuUnicode — Unicode sequences(Capturing group[A-Z]Any of: A-Z)End of group\wAny word character (letter, digit, _)+One or more (greedy)