Skip to content
useToolz online tools

Regex Tester Online

Sign in or register to save tools to favorites

/ /
. — any char
\d — digit [0-9]
\w — word [a-zA-Z0-9_]
\s — whitespace
^ — start of line
$ — end of line
* — 0 or more
+ — 1 or more
? — 0 or 1
{n,m} — n to m times
[abc] — char class
(x|y) — alternation
(?:...) — non-capture
(?=...) — lookahead
(?<=...) — lookbehind
\b — word boundary

Real-time regular expression testing.

Supports flags: g (global — all matches), i (case-insensitive), m (multiline mode).

Shows all matches found with their positions in the text.

Ask AI about code

It explains, debugs and writes — AI chat, first generation free.

Open AI chat →

Online Regex Tester — Test Regular Expressions with Highlighting

Regular expressions (regex) are a powerful tool for searching, validating, and replacing text by pattern. Our tester highlights matches directly in text, shows capture groups, includes a pattern library, and provides a syntax cheat sheet.

Basic Regex Syntax

MetacharacterMeaningExample
.Any character (except \n)a.c → abc, a1c
\dDigit [0-9]\d{3} → 123
\wWord character\w+ → hello
^ / $Start / end of string^hello$
* / + / ?0+, 1+, 0 or 1colou?r
(group)Capture group(\d+)-(\d+)

Regex Flags

FlagNameDescription
gGlobalFind all matches, not just the first
iCase-insensitiveIgnore letter case
mMultiline^ and $ match per line
sDotallDot matches \n too

Common Patterns

  • Email: ^[\w.-]+@[\w.-]+\.[a-z]{2,}$
  • URL: https?://[^\s]+
  • IP address: \b(?:\d{1,3}\.){3}\d{1,3}\b

Capture Groups

Parentheses create capture groups, allowing you to extract parts of a match separately. Our tester displays all groups for each match.

Frequently Asked Questions

What is the difference between greedy and lazy quantifiers?
Greedy (*, +) capture the longest match. Lazy (*?, +?) capture the shortest.

How to escape special characters?
Use a backslash: \., \*, \(.

Does regex work the same across languages?
Basic syntax is the same, but advanced features (lookbehind, named groups) differ between JavaScript, Python, PCRE, and POSIX.

How to test regex without writing code?
Paste the pattern and test text into our tester — matches highlight in real time and capture groups appear below each match.

For text comparison use Text Diff, for password testing — strength analyzer.

We use cookies for site operation and analytics. Learn more

Upscaled image
Download

Log in to continue

or

Pay without signing up

credits for ₽. Email is needed for the receipt and access to your purchase.

Credits never expire. Already have an account? Log in