use strict; use warnings; my $case1 = "Club: Some Club Comments: "; my $case2 = "Club: Comments: "; for ($case1,$case2){ /(Club:)\h*(.*?)\h*\n/; print "<$2>\n"; }