I was faced w/ having to process a text file today.

The text file was an LDAP export; full of tons of information on each user account.

I only needed one line of the roughly 30 lines in each user’s account information. There are over 200 user accounts in that file; roughly 6000 lines.

My first thought? Let’s try MS Word. Guess what: it’s wildcard find/replace engine is really, really limited. There’s no way to do multi-word find & replaces that have variables in the middle.

Know what saved me? Regular Expressions (regex). UNIX saves the day, again.

As I read the rules on regex, I thought to myself, “These guys have put a LOT of thought into this.” Right after that, I reaffirmed the conclusion I’d made about three years ago: Apple’s done the right thing by using 30 years’ worth of programming genious for the basis of their OS.