The problem is, that this string isn't alway the same.
I need to replace the numbers with names. For example for
19 = "peter"
38 = "luis"
I had the idea, to set a patern before the numbers, and then split by
the patern. (For example [$19], [$38]).
But i really dont find a way, to do this like i want.
I would realy thanksful if anyone can help me by my problem.
Unfortunately, strtok() is the wrong function to use for this -- it modifies the string (and overwrites part of the number).
It would be simpler to just copy, character-by-character, the string until you encounter a digit.
Once you find the digit, read the number, perform your lookup and copy the name to the destination string. Then continue.
[edit]
Are the numbers always surrounded by square brackets?
What about the zeros in the string?
What if a number isn't found in your lookup table?