improved regex preprocessing ver 1.0.4