Regular expressions (regex) are something of a mystery to many developers. We admit that they are something that we use often enough to warrant a deeper understanding of how they work. On the flip side, there are so many tried and tested regex patterns on the Internet, that just reusing one that already exists is easier than trying to create one yourself most times. The subject of regex is much larger than what can be explained in a single chapter in this book.
Therefore, in this chapter, we will merely introduce some of the concepts of regex. For a deeper understanding of regex, further study is needed. For the purpose of this book, however, we will take a closer look at how regular expression are created and how they can be applied to some common programming problems. In this chapter, we will cover the following recipes:
- Getting started with regex - Matching a valid date
- Sanitize input
- Dynamic...