JavaScript Regular Expressions

More Information
  • Structure your patterns and model different types of constraints
  • Clean and optimize code with Regex's processing power
  • Solve common use cases and situations
  • Extract different types of fields correctly
  • Embed regular expressions both in your UI and on the backend
  • Efficiently create guard clauses in your functions using patterns
  • Create blank capture groups to handle inconsistent data
  • Capture parts of a pattern in a group to display, replace, or use character sets to match characters

Regular expressions are patterns or templates that allow you to define a set of rules in a natural yet vague way, giving you the ability to match and validate text. Therefore, they have been implemented in nearly every modern programming language. JavaScript's implementation allows us to perform complex tasks with a few lines of code using regular expressions to match and extract data out of text.

This book starts by exploring what a pattern actually is and how regular expressions express these patterns to match and manipulate user data. You then move on to learning about the use of character classes to define a wild character match, a digit match, and an alphanumeric match. You will then learn to manipulate text and shorten data in URLs, paths, markup, and data exchange, as well as other advanced Regex features.

Finally, you will work through real-world examples, both in the browser and on the server side using Node.js.

  • Build and use patterns in JavaScript to solve real-world problems
  • Simplify complex validation processes by mastering the pattern language in Regex
  • A step-by-step guide along with a lot of real-world examples to manipulate text and crunch data, in URLs, paths, markup, and so on
Page Count 112
Course Length 3 hours 21 minutes
ISBN 9781783282258
Date Of Publication 27 May 2015


Loiane Groner

Loiane Groner has over 10 years of experience in developing enterprise applications. Currently, she works as a business analyst and a Java/HTML5/JavaScript developer at an American financial institution.

She is passionate about technology, publishes articles on her blog, and has presented talks at conferences about Java, ExtJS, Cordova, Ionic, TypeScript and Angular.

She is a Google Developer Expert in Web Technologies and Angular, and a Microsoft Most Valuable Professional in Visual Studio and Development Technologies. She has also authored other Packt books.

Gabriel Manricks

Gabriel Manricks is a full-stack software and web developer, and a writer. He is the CTO at CoinSimple and a staff writer at Nettuts+, where he enjoys learning as well as teaching others. He also freelances in the fields of web consulting, development, and writing.