Regex Tester

Real-time matching, cheatsheet, and code snippet generation.

Regular Expression
//
Test String2 Matches
Contact us at hello@auva.dev or support@auva.dev for help.
Match Breakdown
Match #1 (Index: 14)hello@auva.dev
Group 1hello
Group 2auva.dev
Match #2 (Index: 32)support@auva.dev
Group 1support
Group 2auva.dev
JavaScript
const regex = /(\w+)@(\w+\.\w+)/gi;
const str = `Contact us at hello@auva.dev or support@auva.dev for help.`;

// Test if matches
const isMatch = regex.test(str);

// Get all matches
const matches = [...str.matchAll(regex)];
Python
import re

regex = r"(\w+)@(\w+\.\w+)"
str = """Contact us at hello@auva.dev or support@auva.dev for help."""

# Test if matches
is_match = bool(re.search(regex, str, re.IGNORECASE))

# Get all matches
matches = re.finditer(regex, str, re.IGNORECASE)
Go
package main

import (
	"fmt"
	"regexp"
)

func main() {
	// Compile regex
	re, _ := regexp.Compile(`(?i)(\w+)@(\w+\.\w+)`)
	str := `Contact us at hello@auva.dev or support@auva.dev for help.`

	// Test if matches
	isMatch := re.MatchString(str)

	// Get all matches
	matches := re.FindAllString(str, -1)
}