Many options for this, if-elseif most simple one
If(
Starts With(:col, "S7"), "3"
, Starts With(:col, "S3"), "1"
// and so on
);
you can also chain the if-statements if necessary or use IsMissing(Regex()) for more complicated pattern comparisons. If you can provide example data we can provide better examples (add wanted result column if possible).
-Jarmo