Regex Tester

Test regular expressions and find matches in text

← Back to Tools

Regex Tester

Test regular expressions and find matches in text

🎯 Regex Pattern
//
Common flags: g (global), i (case-insensitive), m (multiline), s (dotall)
πŸ“ Test Text
πŸ“Š Matches

5

matches found

βœ“

Position


Pattern:

/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/gi

Status:

regexTester.validPattern
🎯 Matches
Here are some email addresses to test: john.doe@example.com jane_smith@test.org invalid.email@ user123@domain.co.uk another@example.com notanemail.com admin@sub.domain.net
Groups:
#MatchPositionLengthGroups
1john.doe@example.com3920none
2jane_smith@test.org6019none
3user123@domain.co.uk9520none
4another@example.com11619none
5admin@sub.domain.net15120none
πŸ”„ Replace
Use $1, $2, etc. to reference capture groups
Here are some email addresses to test: [EMAIL] [EMAIL] invalid.email@ [EMAIL] [EMAIL] notanemail.com [EMAIL]
πŸš€ Common Patterns
Email Address

Matches email addresses

/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/gi
Phone Number (US)

Matches US phone numbers

/\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})/g
URL

Matches HTTP/HTTPS URLs

/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi
IP Address

Matches IPv4 addresses

/\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b/g
Credit Card

Matches credit card numbers

/\b(?:[0-9]{4}[-\s]?){3}[0-9]{4}\b/g
Hex Color

Matches hex color codes

/#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/gi
Date (MM/DD/YYYY)

Matches MM/DD/YYYY format dates

/\b(0?[1-9]|1[0-2])\/(0?[1-9]|[12][0-9]|3[01])\/(19|20)\d\d\b/g
Word Boundaries

Matches whole word "test"

/\btest\b/gi
πŸ“š Common Patterns
Character Classes
  • . - Any character
  • \d - Digit (0-9)
  • \w - Word character
  • \s - Whitespace
  • [abc] - Character set
  • [^abc] - Negated set
Quantifiers
  • * - 0 or more
  • + - 1 or more
  • ? - 0 or 1
  • {n} - Exactly n
  • {n,m} - Between n and m
  • {n,} - n or more
Anchors
  • ^ - Start of string
  • $ - End of string
  • \b - Word boundary
  • \B - Non-word boundary
Groups & Flags
  • (abc) - Capture group
  • (?:abc) - Non-capture
  • g - Global match
  • i - Case insensitive
  • m - Multiline
  • s - Dotall