The strtok function allows you to extract tokens from strings. To extract the PD token, use
char *token = strtok(scratchpad, "-0123456789");
Then, modify the scratchpad string to remove the token.
To get the X and Y values, use
char *xStg = strtok(scratchpad, ",");
char *yStg = strtok(NULL, ";");
The second call uses NULL as the string to process, so the same string (as specified in the last call that didn't pass a NULL) continues to be parsed.
The first call stops processing when a minus sign or a digit is found, but that delimiter is pointed to, so we need to remove the token and start over with the now-modified string. Otherwise, the next token would begin with the character following the delimiter, which is not what we want.