Using Regular Expressions
As previously explained, there is no regular expressions program; it is not an application you run nor software you buy or download. Rather, the regular expressions language is implemented in lots of software products, languages, utilities, and development environments.
How regular expressions are used and how regular expression functionality is exposed varies from one application to the next. Some applications use menu options and dialog boxes to access regular expressions, and different programming languages provide functions or classes of objects that expose regex functionality.
Furthermore, not all regular expression implementations are the same. There are often subtle (and sometimes not so subtle) differences between syntax and features.
Appendix A, “Regular Expressions in Popular Applications and Languages,” provides usage details and notes for many of the applications and languages that support regular expressions. Before you proceed to the next lesson, consult that appendix to learn the specifics pertaining to the application or language that you will be using.
Before You Get Started
Before you go any further, take note of a couple of important points:
When using regular expressions, you will discover that there are almost always multiple solutions to any problem. Some may be simpler, some may be faster, some may be more portable, and some may be more capable. There is rarely a right or wrong solution when writing regular expressions (as long as your solution works, of course).
As already stated, differences exist between regex implementations. As much as possible, the examples and lessons used in this book apply to all major implementations, and differences or incompatibilities are noted as such.
As with any language, the key to learning regular expressions is practice, practice, practice.
I strongly suggest that you try each and every example as you work through this book.