better handling for escaped regexp