My apologies if this doesn't quite make sense, hopefully it comes across ok.

I have an app that you can specify a regex in a config file that is used to match against a list of items. It then has various config options as to what to do with the captured groups, eg if the regex matches this item:

data_20190503_120303.tsv

with regex of

data_(?<yyyy>\d{4})(?<MM>\d\d)(?<dd>\d\d)_(?<hh>\d\d)(?<mm>\d\d)(?<ss>\d\d)\.tsv

Then it might have config entries of how to use the captured groups

groupby=$yyyy$MM$dd orderby=$yyyy$MM$dd$hh$mm$ss

This is working quite well but then I thought I would add some features such as converting month like Jan, feb etc to 01, 02 so define it like this:

orderby=$yyyy${convertMonth:$MMM}$dd

Then I've added a few other functions and features. So I've started to define a language as how to assemble the captured group.

So, my question is, does something like this exist? Am I reinventing the wheel? Is there something that exists that would have a ton of features?

0 Answers