TuttiTools
.*

Regex Tester

Test regular expressions with real-time matching and group highlighting

/ /

Matches (0)

No matches found.

What is a Regular Expression?

A regular expression (regex) is a sequence of characters that defines a search pattern. It’s used to find, match, and extract text that follows a specific format β€” like phone numbers, email addresses, dates, or any pattern you can describe. Regular expressions are supported in nearly every programming language and text editor.

While powerful, regex syntax can be tricky to get right. A small mistake β€” a missing backslash, a misplaced quantifier β€” can make a pattern match nothing at all, or worse, match the wrong things. Testing patterns live as you write them makes the process much faster and less error-prone.

What Does This Tool Do?

This tool lets you write a regular expression and test it against sample text in real time. All matches are highlighted as you type, and any capture groups are shown separately. You can also test different flags like global matching, case-insensitivity, and multiline mode.

How to Use This Tool

  1. Enter your regular expression in the pattern field.
  2. Paste or type the text you want to test in the input area.
  3. Matches are highlighted instantly as you type.
  4. Captured groups are shown below the match list.
  5. Toggle flags (global, case-insensitive, multiline) as needed.

Common Use Cases

Regex Syntax Cheat Sheet

PatternMatches
.any single character (except newline)
\d / \Da digit / anything that isn’t a digit
\w / \Wa word character (letter, digit, _) / anything else
\s / \Swhitespace / non-whitespace
[abc]one of a, b, or c
[^abc]any character except a, b, c
a* / a+ / a?zero or more / one or more / zero or one a
a{2,4}between two and four as
^ / $start / end of line (or string without m flag)
`(catdog)`
(?:…)group without capturing
(?<name>…)named capture group
(?=…) / (?!…)lookahead: followed by / not followed by
\bword boundary

Handy Patterns to Start From

GoalPattern
Email (pragmatic)[\w.+-]+@[\w-]+\.[\w.]+
URLhttps?://[^\s]+
ISO date (2026-07-04)\d{4}-\d{2}-\d{2}
Time (14:30)`([01]\d
Integer or decimal-?\d+(\.\d+)?
HEX color#(?:[0-9a-fA-F]{3}){1,2}\b
Duplicate words\b(\w+)\s+\1\b
Trailing whitespace[ \t]+$ (with m flag)

These are practical starting points, not bulletproof validators β€” adapt them to your data. For email in particular, full RFC-compliant validation is famously impractical with regex alone; validate the format loosely and confirm with a verification email.

Understanding Flags

Frequently Asked Questions

What regex flavor does this tool use?

This tool uses JavaScript’s built-in regular expression engine, which follows the ECMAScript standard. It supports most common regex features including groups, lookaheads, and character classes.

Why isn't my pattern matching anything?

Common causes: forgetting the global (g) flag for multiple matches, incorrect escaping of special characters, or using a feature not supported by the JavaScript engine (like lookbehinds on older browsers).

Is my data private?

Yes. All pattern matching runs locally in your browser β€” no text is sent to any server.

What is catastrophic backtracking?

Certain patterns β€” typically nested quantifiers like (a+)+ β€” can force the regex engine to try an exponential number of combinations on non-matching input, freezing the page or, on a server, enabling a denial-of-service (ReDoS). If a pattern feels slow, avoid nesting quantifiers and prefer more specific character classes over .*.

Do I need to escape special characters?

Yes β€” characters that have regex meaning (. * + ? ( ) [ ] { } | ^ $ \ /) must be escaped with a backslash to match literally. To find the text 3.50, write 3\.50; otherwise the . matches any character and 3450 would also match.