Extracting tags from text file

Hi there,

Does anyone have a robust way to extract all tags from a file, given just the raw markdown? In addition to inline versus frontmatter case handling, there are also different ways to create the tags field in frontmatter (comma-separated, bullet list, etc.)… I thought I would check here to see if anyone has written a script to handle tag extraction before jumping in to handling all of these cases myself.