This will work only for the first occurrence in a line, because you omitted the "g" in hte commands options, probably an oversight. But even given this it will work only in the sample case of trailing blanks, but will fail in case of blanks within values:
|first|second |third fourth|
will give you:
|first|second|third|
This one would work as expected, though (replace "<spc>" and "<tab>" with literal spaces/tabs):
No. It will remove trailing spaces (if present) only in the second field. The first field will always match, since the spaces are optional (there is only one space in my regular expression). The second match will always be the second field.
I believe you omitted a * quantifier, otherwise your re will only match a second field with a single non-blank followed by blanks. But including the * could lead to a problem with greediness spilling over into subsequent fields if the second field has no blanks. The first [^<spc><tab>] should be [^|] . Regardless, it will fail to remove trailing blanks if there is an embedded blank.
If trailing spaces in the second field need to be deleted, I believe my suggestion is both accurate and robust.