Standalone code
def f(s):
idx = s.upper().index('S')
s = s[:idx]
for i in reversed(range(len(s))):
if s[i].isalpha():
s = s[i+1:]
break
return s
Testing
print f("6S2Olch1E")
print f("5B66S2Olch1E")
print f("54F5456B666S2Olch1E")
Field Calculator
f(!fieldName!)