I blogged about mod_sed a couple of months ago. At the time, I think I explained in outline why it’s an advance on its predecessors, including mod_line_edit and mod_substitute. But one key part was missing: any discussion of how to take advantage of sed’s capabilities, beyond the simple string or regexp search-and-replace of the earlier modules. That matters because few of us are power-users of sed who know what we can do with it, and even those who are may not realise how original-sed translates to mod_sed.
Now Basant has filled that gap, with a blog entry describing advanced usage. He shows a range of programmatic usage of sed within the filter, starting with branches and conditionals, and moving on to block-structuring and advanced buffer manipulation. For those who want advanced text manipulation in an Apache filter, this is a great kick-start to learning what sed can do for you.