JavaScript Regular Expressions in Detail
Explore JavaScript regular expressions: learn about regex history, create patterns with special characters, parse data, and match passwords/emails, gaining comprehensive text processing skills.
Fernando Doglio has worked as a developer for the past 16 years. In that time, he has come to love the Web and has had the opportunity to work with most leading technologies, such as PHP, Ruby on Rails, MySQL, Node.js, Angular.js, AJAX, REST APIs, and others. For the past 6 years Fernando has also been working as a Technical Manager and Technical Lead for BigData projects. In his spare time, Fernando likes to tinker, learn new things, and write technical articles and books such as this one. He’s also a big open source supporter, always trying to bring new people into that realm. When not programming, he is spending time with his family.
Join 3.1 million developers at
What You'll Learn
- Identify regex history, key terms, and types (POSIX vs PCRE) used in JavaScript
- Define JavaScript regex using literals and RegExp objects, selecting the right approach
- Construct patterns with classes, quantifiers, groups, anchors, and lookarounds
- Apply regex flags to control global, case-insensitive, multiline, Unicode, and sticky matching
- Use RegExp methods and lastIndex (exec, match, matchAll, split) to extract match data
- Parse real text into structured outputs (phrases to arrays, dates to Date objects) with regex
- Implement and test regex for URL, email, and password matching and complex replacements
Learning Roadmap
1.
The Beginning of Regular Expressions
The Beginning of Regular Expressions
2.
The Anatomy of Regular Expressions
The Anatomy of Regular Expressions
3.
The RegExp Object
The RegExp Object
6 Lessons
6 Lessons
4.
Thinking in Regular Expressions
Thinking in Regular Expressions
8 Lessons
8 Lessons
5.
Regular Expressions in the Wild
Regular Expressions in the Wild
6 Lessons
6 Lessons
Fernando Doglio
Author of several JavaScript-related books, maker of software products since 2004 and all around geek.
Trusted by 3.1 million developers working at companies
Anthony Walker
@_webarchitect_
Evan Dunbar
ML Engineer
Software Developer
Carlos Matias La Borde
Souvik Kundu
Front-end Developer
Vinay Krishnaiah
Software Developer
Built for 10x Developers











