#! /usr/bin/perl use strict; use warnings; use Data::Dumper; $Data::Dumper::Useqq = 1; # Baue den Regex nach und nach auf my $regex = qr{ class='([^']+)' # Klasse einfangen .*? # TODO: Bus value einfangen # TODO: ECU value einfangen # TODO: Deviation einfangen }x; my $i = 0; while ( my $line = ) { if ( my @result = $line =~ $regex ) { print Dumper( \@result ); } else { warn "No match for: $line"; } } __DATA__ Bus SignalBus ValueECU VariableECU ValueDeviationState TEMP_EX-40Com_tEnvT_FA-38.51.5CONVERSION FAILED TEMP_EX-39.5Com_tEnvT_FA-38.51CONVERSION FAILED TEMP_EX22Com_tEnvT_FA-38.560.5CONVERSION FAILED TEMP_EX83.5Com_tEnvT_FA-38.5122CONVERSION FAILED TEMP_EX84.5Com_tEnvT_FA-38.5123CONVERSION FAILED TEMP_EX85Com_tEnvT_FA-38.5123.5CONVERSION FAILED