Handle multiple timestamp formats, escape code
Move search and replace into a loop to handle multiple timestamp
format strings. Include a limit on maximum number of iterations to
avoid any potential infinite loops (512 ought be enough for anybody).
Add check for empty %% group to allow using '%%%%' as '%%', two
literal percent signs.
Comments! Document all the things.
Examples:
All Quassel clients vanished from the face of the earth... %%hh:mm:ss%%
> All Quassel clients vanished from the face of the earth... 23:20:34
Away since %%hh:mm%% on %%dd.MM%% - %%%% not here %%%%
> Away since 23:20 on 21.05 - %% not here %%