my @matches = / He\d #Match 'He' followed by a single digit. (.+?) #Capture characters non-greedily ~~ #until the end marker is reached /gx; #The g modifier matches multiple instances #into the @matches list