On Fri, May 3, 2013 at 3:24 PM, "H. Özoguz" <h.oezoguz@mmnetz.de> wrote:
Is it possible to define an automatic replacement?

I want to replace every

اللَّـه
by
اللهِ

First is a combination of letters, second is the correct arabic one-symbol for the name "Allah". I know, I can do this in the editor, but would helpful, if it is possible in the compiling.

Huseyin


\directlua{ local function replace_txt (buffer) buffer=string.gsub(buffer,"A","BB") return buffer end
callback.register("process_input_buffer",replace_txt)
}

\starttext my text A \stoptext

copied & pasted in real time at 16:04 on friday May 3 from the Hans's talk at bachotek 2013 about luatex and plain tex.
Please test with your characters.
 
--
luigi