Using Raku (formerly known as Perl_6)
~$ raku -ne 'BEGIN my $l; $l++ && next if /Success/; .put if $l==2;' file
#OR:
~$ raku -ne 'BEGIN my ($l,$n)=(0,0); /Success/
?? ($l++ and $n=1)
!! (.put if $l==2 and $n==1);' file
Here's an answer written in Raku that is inspired by the excellent Perl answer already posted by @terdon. (Note the Sample Input has been modified slightly such that only the word "Success" is capitalized). The first answer above mimics @terdon's answer, while the second answer used Raku's shorthand Test ?? True !! False operator (similar to if/else). Since Raku understands chained comparisons, the .put clause can actually be written .put if 2 <= $l < 3:
Sample Input:
unsuccessful
Success
something
anything
Success
somebody
anybody
someone
Success
again
Sample Output:
somebody
anybody
someone
Pushing matches onto an array, then retrieving by index:
~$ raku -ne 'BEGIN my ($i,$j,$n) = (0,0,0); state @a;
if /Success/ { @a[$i++;0] = $_; $j=0; $n=1 }
else { @a[$i-1;++$j] = $_ if $n == 1 };
END .[1..*].put for @a[1];' file
Here's another way to do it using an Array-of-Arrays (i.e. a 2D-array). Basically when Success is encountered that sets the n=1 flag and lines are pushed onto the @a array in the $i++th position. The line containing the word Success is always pushed onto the array at the 0th position of the second (i.e. $jth)-dimension, and the else block ensures that successive lines accumulate there (at the ++$jth position per Success encountered). The END block sets the return. If the END block is given no slice (indexing) parameters, everything is returned:
Sample Output ( END .put for @a;* ):
Success something anything
Success somebody anybody someone
Success again
To return the second array element, that's just @a[1]. To return the second array element minus the match (Success), that's just .[1..*].put for @a[1]. The OP can adjust the range as required, basically .[1..*].put for @a[ ($x..^($x+$y)) - 1 ], where $x is the 1-indexed first array element that the OP wants returned, and this extends for $y array elements (note: ^ here says to return up-to-but-not-including the last range element):
Start return at 2nd match ($x=2) and continue for 2 matches ($y=2):
Sample Output (END .[1..*].put for @a[ (2..^(2+2)) - 1 ];):
somebody anybody someone
again
* Change .put to .join("\n").put to break-up return into individual lines.
(Rosetta Code 2D-array example)
https://docs.raku.org
https://raku.org