ITT
regex
developer
testing
validation
Updated 2026-02-14

Regex Tester & Debugger

Test and debug regular expressions with live highlighting and match details.

Tool Area

Instant client-side processing

Regex Pattern

g

Enter your pattern to match against

/
/

Target Text

Enter text to test your pattern

Live Match Details

Enter a pattern and test text to see highlights

Pattern Library

## Master Regular Expressions Regular Expressions (Regex) are the superpowers of text processing. Whether you're validating user input, scraping data from websites, or refactoring code, a well-crafted regex can save hours of manual work. The **Regex Tester & Debugger** provides a real-time environment to test your patterns against various text scenarios. ### How Regex Works A regex pattern describes a set of strings. The engine scans your text from left to right, attempting to match your pattern. - **Literal Characters**: `abc` matches "abc". - **Metacharacters**: Special characters like `.`, `*`, `+`, `?` have specific meanings. - **Character Classes**: `[a-z]` matches any lowercase letter. `\d` matches any digit. ### Common Patterns Cheatsheet | Use Case | Pattern | Explanation | | :--- | :--- | :--- | | **Email Address** | `^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$` | Validates standard email formats. | | **Phone (US)** | `^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$` | Matches (123) 456-7890 or 123-456-7890. | | **Date (YYYY-MM-DD)** | `^\d{4}-\d{2}-\d{2}$` | Matches ISO 8601 dates. | | **URL (Simple)** | `https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}` | Matches standard web URLs. | | **Password Strength** | `^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$` | Minimum eight characters, at least one letter and one number. | ### Understanding Flags Flags change how the engine parses your pattern. - **Global (g)**: Don't stop after the first match. Find all matches. - **Case Insensitive (i)**: Treat 'A' and 'a' as the same character. - **Multiline (m)**: The `^` and `$` anchors match the start/end of each line, not just the whole string. ### Performance Tips - **Avoid Catastrophic Backtracking**: Nested quantifiers like `(a+)+` can cause the engine to hang on non-matching inputs. - **Be Specific**: Use `[^<]*` instead of `.*`, which is greedy and often matches too much. - **Use Anchors**: `^` (Start) and `$` (End) speed up the engine by limiting where it checks.

Common Questions

QWhy is my regex matching too much?

Regex is 'greedy' by default. Using `.*` will match as much as possible. Add a `?` (e.g., `.*?`) to make it 'lazy' and stop at the first opportunity.

QWhat is a capture group?

Parentheses `(...)` group parts of your pattern. The engine 'captures' these matches so you can extract them or reference them later using `$1`, `$2`, etc.

QDifference between `*` and `+`?

`*` matches 0 or more times (optional). `+` matches 1 or more times (mandatory).

QHow do I match a literal dot `.`?

The dot is a special wildcard. To match a real dot, escape it with a backslash: `\.`. Same applies to `?`, `*`, `+`, `(`, `)`.

QIs this PCRE compatible?

Yes, our Javascript engine supports most PCRE features used in PHP and Python, except for some advanced lookbehind assertions.