sort list by string length to optimize match