my $string = 'Ich suche ein Zahl 123 oder irgendetwas anderes 23.'; if( my ($erste_zahl) = $string =~ m/(\d+)/ ) { my $pos = index( $string, $1 ); printf "Es wurde [%d] beginnend an Position %d bis Position %d gefunden.\n", $erste_zahl, $pos, $pos + length( $erste_zahl); } # oder: if( my ($prefix, $ersteZahl ) = $string =~ /^(\D*)(\d+)/ ) { printf "Position: %d\tZahl: $ersteZahl\n", length( $prefix ); }