Drop all databases except the _internal database?

I wonder if there is a command or regex in the influx CLI tool to drop all databases that a matched a string pattern? e.g. if I want to clear all databases that start with prefix “test_”?

I don’t believe we support patterns against DROP DATABASE. You’d need an external script to match the output of SHOW DATABASES and then execute DROP DATABASE with those names.