What is a regular expression?
A regular expression (or regex or regexp) is used when searching for things. A regex tells the computer what to look for – it’s a pattern to match against.
Why do I care about those then?
Regular expressions are used all over the place in UNIX and Linux systems – usually but not always in command-line tools like grep and sed. There are regular expression search-and-replace engines available in most programming languages, including Perl, PHP, C and Java. Regex search and replace functions are available in emacs, sed and vi, amongst others. [continued…]