I have tried many times but no luck.formatlist treats [ as the beginning of a range and # as a digit, so you need to escape them by surrounding them with []
I haven't formally learned regular expressions yet, and you can see the mess of expressions in my code...