import re
list_of_filenames = [
"[todo] 2022-04-21-if-you-use-git-you-should-be-very-liberal-in-deleting-stale-code.markdown",
"[UNP] 2022-04-21-will-somebody-please-think-of-the-labels-lessons-learned-in-applied-ml.markdown",
"[WIP] 2021-11-21-some-thoughts-on-software-complexity.markdown",
"[TODO] 2022-04-21-if-you-use-git-you-should-be-very-liberal-in-deleting-stale-code.markdown",
"[unp] 2021-04-21-yada-yada.markdown",
]
sorted(list_of_filenames, key=lambda a: re.sub(r"""(?i)^\[\w+\]\s*""", "", a), reverse=True)
['[UNP] 2022-04-21-will-somebody-please-think-of-the-labels-lessons-learned-in-applied-ml.markdown', '[todo] 2022-04-21-if-you-use-git-you-should-be-very-liberal-in-deleting-stale-code.markdown', '[TODO] 2022-04-21-if-you-use-git-you-should-be-very-liberal-in-deleting-stale-code.markdown', '[WIP] 2021-11-21-some-thoughts-on-software-complexity.markdown', '[unp] 2021-04-21-yada-yada.markdown']