Replace match with end_with: more readable, faster