extract to sortMatchedStrings