make highlight matching more general