Regular Expression Recipes for Windows Developers: A Problem-Solution Approach (A Problem-Solution Approach)

Published Sun, Apr 16 2006 19:52 | William
My buddy Brian Davis is probably one of the most kick a55 regex gurus I've ever come across. That's created a little bit of a problem b/c whenever I need a regex, even a really complex one, he can usually whip it up in his head faster than I can describe it to him.  At work, we do a tremendous amount of document processing and manipulation and Regex's have made all the difference there. Before my old boss, got there, we had about 15k lines of VBA Word Macro code to handle all of our processing. It was icky, error prone and a nightmare to maintain (any time anyone wants to reminisce about the good old days, whip out the Visual Basic Editor in Word and have them create a simple class library that does anything useful. That should shut them up pretty quickly) and since we were invoking it through .NET, it was comparatively slow.  I started playing with Regex's but I was still learning them and there was just too much code to replace (not to mention that if you screw anything up, it causes big problems immediately). Then Brian started and fixed everything.  Code is so much easier to deal with and maintain now and accuracy and speed have increased so much it's hard to even believe we used to do anything else.  But that also means that we have some pretty sophisticated Regex's.  Being the only person there that is any good at Regex's is a little dangerous b/c Brian's the only one that can work with many of the more complex ones.

So for a while, I've decided to learn Regex's well once and for all. I get all gung ho for a few days and then get caught up in other things.  Anyway, I'm back in one of the "I really need to learn this stuff once and for all" phases. So I just picked up Regular Expression Recipes for Windows Developers: A Problem-Solution Approach (A Problem-Solution Approach)
and man, it's awesome.  I bought Dan Appleman's Regular Expressions with .NET a while ago and it was a great reference book.  And while I can't speak well enough of Dan's book, this one is basically just example after example with in depth explanations about what's being done and why.  So it's not really a reference book but it's so heavy with examples (damned good ones for that matter) and explanations that you can pretty much figure out just about anything after using it. I've spent about 6 hours with it and am already a lot more confident in working with Regex's. I think it's going to be a work in progress with this, just keep working through them and see what happens and why - but this may be one of the best investments I've made in a long time.

It's true that in many places knowing Regex's may be little more than a luxury, but in my case, Text Parsing is everything b/c it's at the core of everything important we do at my company.  I've come across quite a few great books lately and this ranks up there with the best of the.  If you need to get up to speed with Regular Expressions in .NET, a copy of Dan's book and this one will almost certainly get you anywhere you need to go.

Comments

# Jason Haley said on April 17, 2006 5:22 AM:

Search

This Blog

Tags

Community

Archives

News

My other sites

Cool Stuff

Book Stuff

Security

ORM

Data Access

Funny Stuff

Compact Framework Stuff

Web Casts

My KnowledgeBase Articles

My MVP Profile

Design Patterns

Performance

Debugging

Remoting

My Fellow Authors

My Books

LINQ

Misc

Speech

Syndication

Email Notifications