Broaden matching code and add support for text label prefixes