while($line=~/\\includegraphics\[.*?\]\{(.+?)\}/gc) { my $pfad=$1; print "Pfad: $pfad\n"; } }