Search for a certain combination of strings in serial and read the following characters until another set character stops the search
Firstly you should really be working with a C string (char *) instead of a String object, otherwise you will be massively fragmenting your heap with the string manipulations to come.
Once you have your data in a C string (char array) you can use strtok_r to split the string on the | character, then for each substring further split it on the :.  You need the _r variant of strtok to make it &quot;re-entrant&quot; so you can have two tokenizations at once nested.
For example (untested):
char *data = &quot;&lt;Idle|MPos:158.500,0.000,0.000|FS:0,0|Pn:H|Ov:100,100,100|SD:0.21,/instruction.nc&gt;&quot;;
char *pair; // Pointer to a K/V pair
char *pairptr = data; // Pointer for outer strtok

// Split the string on the first |
pair = strtok_r(data, &quot;|&quot;, &amp;pairptr);

// While we have a K/V pair
while (pair) {
    char *kvptr = pair;
    // Split the substring into two parts on the colon
    char *key = strtok_r(pair, &quot;:&quot;, &amp;kvptr);
    char *val = strtok_r(NULL, &quot;:&quot;, &amp;kvptr);
    if (val) { // If we split the data correctly:
        if (strcmp(key, &quot;SD&quot;) == 0) { // If the key is &quot;SD&quot; then
            Serial.print(&quot;SD data: &quot;);
            Serial.println(val);
        }
    }
    // Get the next string portion
    pair = strtok_r(NULL, &quot;|&quot;, &amp;pairptr);
}

Once you have your val you can further split that down on commas in the same way as it's been split on the colon.