Not that fancy, but straightforward.
#!/usr/bin/perl -w
use strict;
my $string = "stash_ST1.2.3.4_1.ROLLBACK.check.20170228-101051.435944.
+txt";
my $action = '';
my @parts = split(/\./, $string); # split on dot
for (0..$#parts){
# slot after ROLLBACK
$action = $parts[$_+1] if $parts[$_] eq "ROLLBACK";
}
print "$action\n";
I'm sure this can be golfed down a bit.
"I do not feel obliged to believe that the same God who endowed us with sense, reason and intellect has intended us to forgo their use." -Galileo