Regular Expressions Back

In the context of this book, a regular expression is a specific text pattern that you can use with many modern applications and programming languages.

History of the Term "Regular Expression"

The term regular expression comes from mathematics and computer science theory, where it reflects a trait (特點) of mathematical expressions called regularity.

All a practical programmer needs to remember is that some ivory tower (象牙塔) computer scientists get upset about their well-defined terminology being overloaded with technology that's far more useful in the real world.

With the proper regular expression, it takes just a few line of code, or maybe even one line, to extract something we want in a large text body. However, even if it's convenient, you are not supposed to abuse them where they're not really appropriate.

There are so many regular expression flavors in a modern programming world, which can traced their history back to the Perl programming language. Their syntax is very similar, and mostly compatible, but not completely so. According to the book, "[O`Reilly] Regular Expressions Cookbook", what flavors covered are respectively .NET, Java, JavaScript, XRegExp, PCRE, Perl, Python and Ruby. Actually, JavaScript is the flavor that mainly talked about here.

Before learning, here is a list of tools for working with Regular Expressions:

Now, we start to talk about Regular Expressions in JavaScript with a category:

Empty Comments
Sign in GitHub

As the plugin is integrated with a code management system like GitLab or GitHub, you may have to auth with your account before leaving comments around this article.

Notice: This plugin has used Cookie to store your token with an expiration.