fixed --pattern with tag replacement