text.hpp: factor out the match data into a text_event data structure