Regex Tester — Test Regular Expressions Online

Enter a regex pattern and test string to see matches highlighted in real-time.

//

Common Regex Patterns

Email: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}

URL: https?:\/\/[^\s]+

Phone: \+?[\d\s\-()]+

Date (YYYY-MM-DD): \d{4}-\d{2}-\d{2}

IP Address: \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}

Frequently Asked Questions

What is a regular expression?

A regular expression (regex) is a pattern used to match character combinations in strings. It's used for searching, replacing, and validating text in virtually every programming language.

What do the flags mean?

g (global) finds all matches, not just the first. i (case-insensitive) ignores uppercase/lowercase differences. m (multiline) makes ^ and $ match start/end of each line instead of the whole string. s (dotAll) makes . match newline characters too.

Why is my regex not matching?

Common issues: forgetting the global flag (g) to find all matches, not escaping special characters (. * + ? need \), or using ^ and $ without the multiline flag (m) for multi-line text.

What are capture groups?

Parentheses () in regex create capture groups that extract specific parts of a match. For example, (\d{4})-(\d{2})-(\d{2}) captures year, month, and day separately from a date string.

Is this tool safe for testing sensitive data?

Yes. All regex processing happens entirely in your browser using JavaScript's built-in RegExp engine. No data is sent to any server.

Related Tools

Convert Case — Transform text between different cases.

Word Counter — Count words and characters.

View All Tools