← Back to tools

Regex Tester

Write regex patterns and see matches highlighted in real time.

/ /
Test String
Matches
Common: Email IP Address Phone Date (YYYY-MM-DD) URL

Regular expressions (regex) are patterns used to match, search, and manipulate text. They're built into every programming language and are essential for input validation, log parsing, data extraction, and find-and-replace operations.

A regex pattern consists of literal characters and metacharacters like . (any character), * (zero or more), + (one or more), \d (any digit), and \w (any word character). Grouping with parentheses () lets you capture matched portions for extraction or backreferences.

Flags modify matching behavior: g (global — find all matches), i (case-insensitive), and m (multiline — ^ and $ match line boundaries). This tool highlights matches in real time so you can iterate on your pattern before embedding it in code.

This tool in other languages:

Français:
Testeur d'expressions régulières

Español:
Probador de expresiones regulares

Deutsch:
Regulärer Ausdruck Tester

Português:
Testador de expressões regulares

日本語:
正規表現テスター

中文:
正则表达式测试工具

한국어:
정규식 테스터

العربية:
اختبار التعبيرات النمطية

Frequently asked questions

How do I test a regular expression online for free?

Type your regex pattern in the input box and paste the text you want to match below. Matches are highlighted live as you type — no need to click a button. The tool shows capture groups, match count, and supports standard JavaScript regex flags.

What regex flavor does this tester use?

It uses JavaScript's built-in RegExp engine (ECMAScript). Patterns that work here will work in Node.js, browser JS, TypeScript, and most modern frameworks. For Python, PCRE, or .NET regex, syntax differences may exist (like lookbehinds or named groups).

How do I see capture groups in my regex?

Add parentheses around the part of your pattern you want to capture, e.g. (\d{4})-(\d{2})-(\d{2}). The tool will show each captured group numbered in the results panel, along with its position in the string.

What are the common regex flags and when should I use them?

g finds all matches (not just the first), i is case-insensitive, m makes ^ and $ match line starts/ends instead of the whole string, s lets . match newlines, and u enables Unicode support. Combine them as needed, e.g. /pattern/gi.

Why isn't my regex matching what I expect?

Most common issues: forgetting to escape special characters like ., ?, or + with a backslash; using greedy quantifiers (.*) when you want lazy (.*?); or missing the g flag when you expected multiple matches. The live highlighting will show exactly what your pattern captures.

Is the regex cheat sheet separate from the tester?

Yes — DeskTools also has a dedicated Regex Cheat Sheet with searchable patterns, examples, and explanations for character classes, quantifiers, anchors, groups, and lookaheads. Use it as a quick reference while building patterns in the tester.