I am facing the following problem in a script I am trying to develop:
Given a string and a set of tokens, where the tokens are known and are overlapping (the set can contain the tokens 'a', 'b' and 'ab'), I need to split the string into a list of tokens from the set. I know there can be multiple ones, I don't need all of them, just a random one (obviously it is trivial to get an arbitrary one if I have all possible token lists).
The token set is known and guaranteed to have all possible characters of the input string, there is at a token which is equal to a single character for each possible input character.
Is it a known problem? If so, does it have known solutions? I am happy with adjacent literature I can use to jump-start my research.