my $string = "TRIM(' Nachname ') ,TRIM(' Vorname ') , 56424 , TRIM(' Ort ') , TRIM(' Text ')"; my @extracted = $string =~ /('[^']+')/g; print $_,"\n" for(@extracted);