Longest token match support