Developer

Free Regex Tester

Test and debug regular expressions with live match highlighting.

Quick patterns:
//

About this tool

Regular expressions (regex) are powerful patterns used to match, search, and manipulate text. They are a fundamental tool for developers, data engineers, and anyone who works with text processing. Regex can match email addresses, URLs, phone numbers, dates, and custom patterns in seconds. This tool provides a live regex testing environment. As you type your pattern, matches are highlighted in real-time in your test string. You can also use Replace mode to preview substitution results before using them in your code. The tester uses JavaScript's native RegExp engine. Quick-load patterns for common use cases (email, URL, IP address, phone numbers) are available so you can start testing immediately without writing regex from scratch.

How to use

Step 1: Enter your regex pattern in the Pattern field (without the / delimiters).
Step 2: Toggle flags (g = global, i = case-insensitive, m = multiline, s = dotAll) as needed.
Step 3: Type or paste your test string in the large text area.
Step 4: Matches are highlighted in orange in the preview area below the test string.
Step 5: Switch to Replace tab and enter a replacement string to preview the result of a replace operation.

Frequently Asked Questions

g (global) - find all matches, not just the first. i (case-insensitive) - match regardless of case. m (multiline) - ^ and $ match start/end of each line. s (dotAll) - dot (.) matches newline characters too.

In regex, characters like . * + ? ^ $ { } | ( ) [ ] \ have special meaning. To match them literally, prefix with a backslash. For example, \. matches a literal dot, and \( matches a literal parenthesis.

A capture group is a portion of the pattern in parentheses, e.g. (\d+). It captures the matched text for later use. Named groups use (?<name>pattern) syntax. In Replace mode, you can reference groups with $1, $2, or $<name>.

By default, quantifiers like * and + are greedy - they match as much as possible. Add ? after a quantifier to make it lazy (match as little as possible). For example, <.*?> matches a single HTML tag, while <.*> might match from the first < to the last >.

^ matches the start of the string (or line in multiline mode). \b is a word boundary - it matches the position between a word character and a non-word character. Use \b to match whole words, e.g. \bcat\b matches 'cat' but not 'catch'.

Related Tools