Summing Up

You have learned a lot in this chapter. What once looked like random characters (ahem, /(?:1-)?\(?(\d{3})[\-\)]\d{3}-\d{4}/, ahem) now makes sense to you. Sure, it might take some time to figure out what it means (and I think it always will), but you can figure it out. Regular expressions are a great tool, but remember that just because you’re holding a hammer doesn’t make everything a nail. In this chapter, you learned about:

Image The regular expression syntax

Image Quantifiers such as ?, +, and *

Character sets in brackets

Groups and capturing ...

Get Learning to Program 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.