I'm looking for a command-line tool where I can specify regex patterns (or similar) for certain file extensions (e.g. cs files, js files, xaml files) that can provide errors/warnings when run, like during a build. These would scan plain-text source code of all types.

I know there are tools for specific languages... I plan on using those too. This tool is for quick patterns we want to flag where we don't want to invest in writing a Rosyln rule, for example. I'd like to flag certain patterns or API usages in an *easy* way where *anyone* can add a new rule without thinking too hard. Often times we don't add rules because it is hard.

Features like source tokenization is bonus. Open-source / free is mega bonus.

Is there such a tool?