my ($label) =~ / # begin \. # find a literal . ( # start capturing [^\.] # Any character that isn't a \ or . * # zero or more ) # stop capturing $ # only match from the end of the string / # end;