refactored anyDelim function