Just based on your example you don't need regex as Word() might be enough
For F
Word(-2, str, ",F+S"); // "18441"
for S
Word(-1, str, ",F+S"); // "18442"
Example
Names Default To Here(1);
str = "-F19,S20+F18441,S18442";
Show(Word(-2, str, ",F+S"));
Show(Word(-1, str, ",F+S"));
-Jarmo