How to write a module to process http response message body?

I am a nginx development novice.Now i need to process the http response
message body.For example , get all numbers in the response html,then
every number times two and use new number instead of the original
number. Do I need to write a new http module or use the existing module?
Which existing module can I imitate?Which function should i foucs on ?

Posted at Nginx Forum:

What about to use the substitutions module(
http://wiki.nginx.org/NginxHttpSubsModule)? You will not get very good
performance I think.

2011/4/15 xinghua_hi [email protected]