I'm trying to parse a text string (char *) using strsep(), the problem is that the separators must be used by order ex.: the first token by ',' the 2nd by ':'...
sep = " ,:-,.!.";
tofree = string;
while (token = strsep(&string, " ,:-,.!."))
{
validate(token);
}
free(tofree);
The strsep() separates by any of the sep chars in the string. After reading strsep() and strtok_r() man, still gone nowere. Is there a way to do this in a while cycle? Any ideas would be helpful. Thaks