some optimizations
removed conditional compiling option RE_REPLACE_SUB