EN FR

Regex Tester Live

Test, visualize, and understand regular expressions in real time. Highlighting, groups, and natural language explanation.
/ /
Ctrl+Enter to re-run  ·  Updates live as you type
Pattern explanation
Enter a regular expression above to see an explanation.
0 matches
Capturing groups
No capturing groups detected.
Common patterns Click to load
Email URL IPv4 Phone (US) Date YYYY-MM-DD UUID ZIP (US) Hex color Strong password IP strict Code comment HTML tag

What is a Regular Expression (Regex) and how to test it online?

A regular expression (regex) is a sequence of characters that defines a search pattern. An online regex tester lets you instantly test, debug, and validate expressions against real text — no setup needed.

Regex is used everywhere in software development: form validation, log parsing, data extraction, search and replace, URL routing, and code refactoring. Mastering regex saves hours of manual text processing.

How to use this regex tester

  • Enter your regular expression in the input field (between the / slashes)
  • Toggle the flags you need (g, i, m, s, u)
  • Paste your test string — matches highlight in real time
  • Use the pattern library to load common expressions instantly

Basic regex syntax

  • . — matches any character except newline
  • * — matches 0 or more occurrences
  • + — matches 1 or more occurrences
  • ? — matches 0 or 1 occurrence (also makes quantifiers lazy)
  • [] — character class (e.g. [a-z0-9])
  • () — capturing group
  • (?:) — non-capturing group
  • ^ — start of string (or line in multiline mode)
  • $ — end of string (or line in multiline mode)
  • \d — digit, \w — word character, \s — whitespace
  • {n,m} — between n and m occurrences

Regex flags explained

g (global) — find all matches, not just the first one.
i (ignore case) — case-insensitive matching.
m (multiline) — ^ and $ match start/end of each line.
s (dotAll) — . also matches newline characters.
u (unicode) — enables full Unicode support and stricter parsing.

Common regex use cases

  • Email address validation in signup forms
  • Password strength rules (length, uppercase, digits)
  • Extracting dates, URLs, or IPs from log files
  • Search and replace in code editors (VS Code, Vim)
  • URL routing in web frameworks
  • Stripping HTML tags from content

Frequently Asked Questions

What is a regex tester?

A regex tester is an interactive tool that lets you test regular expressions against sample text and see matches highlighted in real time — without writing any code.

What is the difference between regex and string search?

A string search finds only exact literal matches. Regex allows complex pattern matching — you can match any digit, any word character, ranges of characters, optional parts, repetitions, and lookaheads/lookbehinds.

What are regex flags and when should I use them?

Flags modify how the regex engine interprets the pattern. Use g to find all matches (not just the first), i when you want case-insensitive matching, m when your text has multiple lines and you need ^/$ to match each line, and s when your pattern needs . to match newline characters.

What is a capturing group in regex?

A capturing group () extracts a specific part of a match. For example, (\d{4})-(\d{2})-(\d{2}) applied to 2024-05-21 captures three groups: 2024, 05, and 21. You can then reference these groups in replacements or code. Use (?:) for a non-capturing group when you only need grouping for logic, not extraction.

What is the difference between greedy and lazy quantifiers?

Greedy quantifiers (*, +, {n,}) match as much text as possible. Lazy quantifiers (*?, +?, {n,}?) match as little as possible. For example, on the text <b>bold</b>, the greedy <.*> matches the entire string, while the lazy <.*?> matches only <b>.

Is my data sent to a server?

No. This regex tester runs entirely in your browser via JavaScript. Your patterns and test strings never leave your machine.

Which regex flavor does this tool use?

This tool uses JavaScript's built-in RegExp engine (ECMAScript regex). It supports most common regex features but differs slightly from PCRE (used in PHP, Python) — notably, JavaScript does not support lookbehind in older engines and has no named backreferences in the replace syntax in some older browsers.

Other useful developer tools