Chapter 17. Regular Expressions

IN THIS CHAPTER

  • Introduction to Regular Expressions

  • Creating Regular Expressions

  • Regular Expression Object Properties

  • Running Regular Expressions

  • Testing, Reading, and Replacing Text with Regular Expressions

Those of you from the Perl world know all about regular expressions. If you don't know much about regular expressions, you're in for a bit of a learning curve, but trust me—it's worth it. Regular expressions allow you to create very compact, robust patterns that you can match against any sort of text data. That may not sound like much, but this allows you to check incoming data, do large-scale search and replaces, test text for correct formatting, and perform general text processing.

Get Advanced JavaScript™: Insights and Innovative Techniques 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.