
learn-regex
A free, plain-language guide to learning regular expressions, with examples you can test.
- Stars
- 46.1k
- Forks
- 6.1k
- Licence
- MIT
- Language
- —
- Last update
- 1.2 years ago
- Type
- Learning resource
No commits in over a year — check for forks or alternatives before adopting.
What it is
This is a tutorial that teaches regular expressions (regex), a way to describe text patterns for searching, validating, and replacing text. It walks through basics like literal characters, character sets, repetition, groups, anchors, lookarounds, and flags, with examples linked to regex101.com where you can test them. A PDF version is also offered through a linked page.
- Learn how character sets like [Tt]he match variations of a word
- Understand how * and + control repetition in patterns
- Build a username validation pattern with length and character rules
- Practice writing patterns by testing the linked regex101 examples
Great for
- Beginners who want to understand regex from the ground up
- Developers who use search-and-replace or form validation and want a refresher
- Students learning text processing for the first time
- Readers who prefer examples they can run in a browser tester
Not ideal for
- People who need a reference for one specific regex flavor, since the README covers general concepts rather than language-specific syntax
- Readers who want interactive exercises, because the material is a written tutorial with linked examples
How to get it
- 1
Read it online
Clone the repository
git clone https://github.com/ziishaned/learn-regex.git - 2
Run it
- Open the README in the repository or the translation of your choice.
- Read the Basic Matchers section and open its regex101 link.
- Edit the pattern in the tester and watch which text it matches.
- Work through the table of contents in order.
- 3
Get the most out of it
- Use the regex101 links to test each example as you read.
- Read the translated versions if English is not your first language.
- Download the PDF from the linked page for offline reading.
Downloads
Strengths
- Explains concepts step by step with short, clear examples
- Each example links to a live tester so you can experiment immediately
- Available in many translations, including German, Spanish, French, and Chinese
Trade-offs
- The README is truncated in this analysis, so later sections such as lookarounds and flags are only partly verified here
- Examples use general regex syntax; behavior can differ between programming languages
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.