E

Regular Expressions 101

Living Dangerously

Regular expressions are useful for matching organized patterns of letters and numbers. Throughout the tutorials in Part 2 of this book you will see that regular expressions can solve a complex pattern matching problem with ease.

There are some simple rules and some not-so-simple rules. The regular expression (or regex for short) is composed of meta-characters and literals. Meta-characters have special meaning, and if you want to use them as literals, they will need to be escaped. The regex is then constructed with framing characters that control the evaluation order. In many ways, they are like a mathematical expression, although they operate on strings of characters.

We will examine sufficient regular ...

Get Developing Quality Metadata 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.