Hi @tiffle. Thanks for sharing. I didn't know that AppleScript would return values from the end when a negative integer is specified. Very cool!
I've adapted your AppleScript and created a new example in MACRO: Text Transformation EXAMPLES - Macro Library.