On Wed, Apr 09, 2008 at 04:32:09AM +0100, Nick Kew wrote:
> On 9 Apr 2008, at 03:40, [EMAIL PROTECTED] wrote:
>> Hi,
>> mod_sed is a sed[1] based Apache filtering module, with the sed code based 
>> on
>> opensolaris sed. sed scripting offers a more familiar interface to build
>> powerful filters. This mod_sed is designed to work with Apache HTTP server
>> version 2.2 and above.
>
> Thanks.  This is useful stuff.  Of course mod_sed overlaps with 
> mod_line_edit
> and mod_substitute, but you're the first to support both input and output
> filtering.  My knowledge of sed itself is limited to the same kind of 
> search-
> and-replace those filters offer, but I have an idea it does a little more 
> than
> just that, too.  Any performance comparisons with its competitors?
I have not yet done any performance comparisons with its competitor but feature
wise sed is very rich. I will try to do some basic performance testing and come
back with results. Besides search and replace and regular expressions, Some of
it's feature are :
1) One can write if/else condition using sed labels and branches.
If (match) do this 
else do that.
2) Read/Write to a file using 'r' and 'w' commands
3) operations on a particular line number.
4) deleting lines on a condition.
5) Using braces to specify multiple operations if a condition matches.
6) inserting and appending text
and many others features.

Here is one of the sed tutorial (from google)
http://www.grymoire.com/Unix/Sed.html

>
>> Design of this filter is in the way that regexp.c, regexp.h, sed0.c 
>> sed1.c,
>> libsed.h can be made part of the apr. While the filter code mod_sed.c
>> will be a filter module which can reside under modules directory. This
>> way other modules can also take advantage of sed libraries.
>
> I think you mean you've adapted the sed code to run on APR pools,
> and updated it for thread-safety/reentrancy.  Once we have a
> modular build system in a release version of apr-util, that could
> perhaps fit nicely as an apr_sed module.  But that's a whole other
> discussion.
>
>> Please have a look into the code and provide your comments.
>
> Well, I've had a preview of this, and it's good :-)
>
> -- 
> Nick Kew

Regards,
Basant.

Reply via email to