Conclusion

Right now, the most important thing to know about regular expressions is that they exist and can make your string-mangling code much shorter. In fact, there is quite a lot more to learn about regular expressions than the material found in this chapter. Look around on the Internet, if you feel like it—the syntax used by JavaScript’s regular expressions is called Perl Compatible Regular Expressions and is found in a lot of other programming languages as well.

This syntax is so cryptic that you’ll probably have to go look up the details the first 10 or so times you need to use it. Persevere, and you will soon be writing brilliantly complicated, occult-looking expressions.

Get Eloquent JavaScript 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.