Thanks to all for the various good approaches. Kent's plain RE approach seems the most straightforward - did not know that RE can handle this situation - good to know!