.*

Regex Tester

Test JavaScript regular expressions live.

//
Contact alice@example.com and bob@test.org for details.
2 matches
#MatchGroupsIndex
1alice@example.comalice | example.com8
2bob@test.orgbob | test.org30

Live JavaScript Regex Tester

Type a regular expression in the left box, flags in the right, and paste the text you want to match below. The tool highlights every match and shows captured groups in a table. It uses JavaScript's native regex engine, so patterns that work here will work in Node.js and browser code.

Regex Flags

  • g — global: find all matches, not just the first.
  • i — case-insensitive.
  • m — multi-line: ^ and $ match line boundaries.
  • s — dot-all: . matches newlines.
  • u — Unicode mode.
  • y — sticky: matches only from lastIndex.

Common Patterns

Email          /[\w.+-]+@\w+\.\w+/i
URL            /https?:\/\/[^\s]+/i
IPv4           /(?:\d{1,3}\.){3}\d{1,3}/
Phone (US)     /\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4}/
Hex color      /#(?:[0-9a-f]{3}){1,2}/i

Regex Cheat Sheet

  • \d digit, \D non-digit
  • \w word char, \W non-word
  • \s whitespace, \S non-whitespace
  • . any char (except newline unless s flag)
  • ^ start, $ end
  • * 0+, + 1+, ? 0 or 1
  • {n,m} between n and m times
  • (...) capture group, (?:...) non-capturing

Related Developer Tools

Cookie and measurement consent

We use analytics and advertising scripts to measure traffic and fund the site. You can accept or reject marketing cookies now, and review the details in our Privacy Policy.