Extract the range-matching-predicate logic from eraseAppended