Categories
Blog

Writing readable regular expressions

I was talking to Ole today about regular expressions, and one of the problems with regular expressions is that it, like SQL, compounds the actual problem into on string, thus making it very hard to read again. Luckily we now have ORM’s to take care of most of the SQL mess, but regular expressions hasn’t received the same kind of limelight. I immediately thought that one could use a similar technique to deal with the regular expression problem, just by expression it as a language (DSL) and running something like LINQ on it. And of course, several people has already been doing this. Nifty stuff!