🔍 Regex Tester & Builder

Build, test, and debug your regular expressions in real-time. Use the builder to create patterns or write your own.

🛠️ Regex Builder

Edit directly or use the builder above
Pattern: \b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b

🧪 Tester & Results

Matches Found
0
Click "Run Test" to see matches
Pattern Explanation:
\b - Word boundary
[A-Za-z0-9._%+-]+ - Local part
@ - Literal @
[A-Za-z0-9.-]+ - Domain name
\. - Literal dot
[A-Za-z]{2,} - TLD (2+ letters)
\b - Word boundary

📋 How to Use Regex Tester & Builder

1

Build Your Pattern

Use the "Build" tab to select common patterns, quantifiers, and anchors from dropdown menus. Click each option to add it to your regex pattern.

2

Or Enter Manually

Switch to the "Manual" tab to type your own regex pattern and flags (like 'g' for global, 'i' for case-insensitive).

3

Enter Test String

Paste or type the text you want to test in the "Test String" area. The tool will automatically highlight matches as you type.

4

View Results

Check the "Matches Found" count and see all matched strings in the list below. The pattern explanation helps you understand your regex.

❓ Frequently Asked Questions

What is a regular expression (regex)?
A regular expression (regex) is a sequence of characters that defines a search pattern. It's used for pattern matching within strings, such as validating email formats, finding specific text patterns, or replacing content. Think of it as a powerful wildcard search.
What do the flags (g, i, m, s) mean?
g (global): Find all matches, not just the first one.
i (case-insensitive): Makes matching case-insensitive (e.g., /hello/i matches "Hello", "HELLO").
m (multiline): Changes behavior of ^ and $ to match start/end of each line.
s (dotall): Allows the dot (.) to match newline characters as well.
Why do I need to escape characters like . or *?
In regex, certain characters have special meanings. For example, '.' matches any character, and '*' means "zero or more". To match these characters literally, you need to escape them with a backslash: '\.' matches a literal dot, '\*' matches an asterisk.
What's the difference between Build and Manual tabs?
The Build tab helps beginners create regex patterns by selecting components from dropdown menus. The Manual tab is for experienced users who want to type patterns directly and specify flags. Both tabs update the same pattern field.
Why am I getting an "Invalid regex" error?
This usually means your pattern has syntax errors. Common issues include: unescaped special characters, unmatched parentheses or brackets, or incorrect quantifier syntax. Check your pattern carefully or try building it piece by piece using the Build tab.
Can I test multiple lines of text?
Yes! The test string area supports multiple lines. Use the 'm' (multiline) flag if you want ^ and $ to match the start/end of each line instead of the entire string.
How do I match a specific word or phrase?
To match exact words, just type them directly. For example, "hello" matches "hello". Use word boundaries (\b) to match whole words only: \bhello\b matches "hello" but not "helloworld". For case-insensitive matching, add the 'i' flag.
What are capturing groups?
Capturing groups are created with parentheses (). They allow you to extract specific parts of a match. For example, (\d{3})-(\d{4}) captures area code and number separately from "555-1234". In this tool, you'll see all captured groups in the matches list.

What is Regex?

Regular expressions are patterns used to match character combinations in strings. They are essential for validation, searching, and text processing.

Common Uses

Form validation (email, phone), log parsing, data extraction, search/replace in code editors, and input filtering.

Tips

Start simple and test often. Use anchors (^ $) to match whole strings. Escape special characters like . * + ? with a backslash.