Learning hub

Learn Regex with examples and practice

Start with the definition, learn through practical JavaScript and number examples, then reinforce each concept with exercises, the online tester, and 24 interactive levels.

Popular learning paths

Start with what developers are practicing now

Choose a focused path or use the complete library below.

Practice

Regex Exercises

30 practice problems with solutions from beginner to advanced.

Practice Regex β†’
Fundamentals

What Is Regex? A Practical Guide with Examples

Learn what regular expressions are, what they are used for, and how to read basic patterns with practical examples.

Read guide β†’
Start here

Regex for Beginners: Learn the Basics Without Memorizing

A beginner-friendly regex path covering literals, character classes, quantifiers, anchors, and practice.

Read guide β†’
JavaScript

Regex in JavaScript: RegExp, test, match, replace and Flags

Practical JavaScript regex guide using literals, RegExp, test(), match(), replace(), and common flags.

Read guide β†’
Python

Regex in Python with re: search, fullmatch, findall and sub

Practical Python regex guide using the re module, raw strings, groups, extraction, and replacement.

Read guide β†’
Recipes

Email Regex: A Practical Pattern and Its Validation Limits

Learn a practical email Regex, understand each part, and see why complete email validation is more complicated.

Read guide β†’
Brazil

Brazilian CPF Regex: Validate the 000.000.000-00 Format

Regex for the common Brazilian CPF format, plus the important difference between formatting and check-digit validation.

Read guide β†’
Brazil

Brazilian CNPJ Regex: Validate the 00.000.000/0000-00 Format

Regex for the common Brazilian CNPJ format with an explanation of formatting versus check-digit validity.

Read guide β†’
Recipes

Phone Number Regex: Practical Patterns and Formatting Choices

Learn phone Regex patterns, optional formatting, international caveats, and why requirements should come first.

Read guide β†’
Web

URL Regex: Practical HTTP and HTTPS Examples

Learn a practical URL Regex for HTTP/HTTPS and understand protocols, domains, paths, and parsing limits.

Read guide β†’
Networking

IP Address Regex: IPv4 Structure and Correct Validation

Learn a basic IPv4 Regex and why four numeric groups are not enough to guarantee a valid address.

Read guide β†’
Recipes

Date Regex: DD/MM/YYYY and Calendar Validation Limits

Regex examples for date formats, plus why matching DD/MM/YYYY does not guarantee a real calendar date.

Read guide β†’
Fundamentals

Number Regex: Integers, Signed Values, and Decimals

Practical Regex examples for digits, signed integers, decimals, and why numeric conversion still matters.

Read guide β†’
Text

Letters-Only Regex: ASCII, Accents, and Unicode

Regex patterns for letters only, including accented characters and Unicode considerations.

Read guide β†’
Dev

Regex for Logs: Filter INFO, WARN, ERROR, Dates, and IDs

Use Regex to filter log levels and extract dates, IDs, and useful fields from application logs.

Read guide β†’
Reference

20 Regex Examples to Copy, Test, and Adapt

Practical Regex examples for digits, words, email, phone, dates, URLs, files, and logs.

Read guide β†’
Practice

Regex Exercises: A Practice Path from Beginner to Advanced

Practice Regex with progressive exercises and learn to use false positives and false negatives as feedback.

Read guide β†’