The only idea I have to do it without a regex would be to check if `-list` is at the end of `t` and then cut off the last 5 characters. That would be less readable than this regex, I'd say.