Thanks for that, which was new to me. It seemed to do what I had in mind.
I raised this a few months ago, but commenters thought I wanted to solve a different problem, such as a tool to check a regex against a group of strings that I would supply myself: