Regular expressions are awesome, but ridiculous. I did not know there were so many implementations and syntax variants. I think it is time to read the book. For the uninitiated (and so that my parents can understand this post), regular expressions are powerful bits of syntax that make search operations (like grep) much cooler and more functional.

For instance, take... uh... google. I know my parents have used google. You can query google with words and phrases, like "cab" if you're looking for websites about taxis. This will give you websites that use the word "cab" in them. (Similarly, if I'm writing a paper about taxis, I might search for all instances of the word "cab" in there.)

What if you want more complicated searches? You can do things like "cab" OR "taxi" or "cab" AND "taxi" which gives you the intersection and union of results containing those words, respectively - not a big deal.

Okay. But wait, why do our search results suddenly return things on cable television? Oh yeah. Cable television. But we just want the word 'cab.' So what if we did something like...

<the word has to start here!>cab<the word has to end here!>

Or in some regular expression syntax variants, ^cab$ (it's faster to type ^ and $ than the tags above).

What if we were studying chromatography and wanted to find references to color - I mean colour - I mean... actually, we don't care how it's spelled, only that it starts with "col" and ends with "r"? (So words like colander and colthisisacompletelymadeupwordr are also things we are, for some reason, looking for.)

We could search for something like this: col<stuff can go in the middle, we don't care>r - or in shorter, more common syntax, col*r, the asterisk (*) being shorthand for "stuff goes in here, but we don't care what it is, or how long." There are special characters and a syntax where you can say things like "A single character goes here, but we don't care what it is as long as it's a character," or "there should be whitespace between these two words - we don't care how much or what kind, you can use tabs, a space, a bazillion spaces, whatever" and search for those.

The list goes on. You can match...

palindromes: ^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?).?987654321$

email addresses: ^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}$

and so on, and so forth, and hooray for simple ideas with great power. (See, mom and dad? This is why I get all excited about these kinds of things. And that's just the tip of the iceberg. And there's far more to it than regular expressions.)