Custom markup language

Is it possible / how difficult would it be to give Middleman a custom file type, and have it format the content based on some regular expression?

.cho files are used to write song lyrics with chords. There is a tool that can be used to convert these files into postscript (ready for printing), but it seems to me, given the simple syntax, they could be equally useful for web pages.

For example

Swing [D]low, sweet [G]chari[D]ot

could become something like

<p>Swing <span data-chord="D">l</span>ow, sweet <span data-chord="G">c</span>hari<span data-chord="D">o</span>t</p>