Unverified Commit 68a9b34d authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Carriage: handle extraneous dashes that are sometimes present

Closes #27
parent 38b6a3f8
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -49,8 +49,11 @@ sub new {
	$ref->{section}       = $json{platformPosition}{sector};
	$ref->{type}          = $json{type}{constructionType};

	if ( defined $ref->{uic_id} ) {
		$ref->{uic_id} =~ s{ ^ \d{11} \K - }{}x;
	}
	if ( defined $ref->{model} ) {
		$ref->{model} =~ s{^.....(...)....(?:-.)?$}{$1}
		$ref->{model} =~ s{^.....(...)...-?.(?:-.)?$}{$1}
		  or $ref->{model} = undef;
	}