Chapter 10. Wrangling regular expressions

This chapter covers

  • A refresher on regular expressions
  • Compiling regular expressions
  • Capturing with regular expressions
  • Working with frequently encountered idioms

Regular expressions are a necessity of modern development. There, we said it. Although many a web developer could go through life happily ignoring regular expressions, some problems that need to be solved in JavaScript code can’t be addressed elegantly without regular expressions.

Sure, there may be other ways to solve the same problems. But frequently, something that might take a half-screen of code can be distilled down to a single statement with the proper use of regular expressions. All JavaScript ninjas need regular expressions as an ...

Get Secrets of the JavaScript Ninja, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.