Thread nicht ganz so einfach Stringmanipulation
(6 answers)
Opened by errorsmith at 2015-01-06 10:35
Vielleicht hilft Dir
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 #!/usr/bin/perl use strict; use warnings; while ( my $line = <DATA> ) { my @candidates = $line =~ m{ "([^"]+)" }xmsg; my @paths = grep{ m{/} }@candidates; print sprintf "found on line %s: %s\n", $., join ', ', @paths; } __DATA__ soundSet = { name = "bus_modern", horn = "vehicle/truck_modern/horn.wav" } id = "vehicle/bus/citaro/lod_0_w2.msh", "vehicle/bus/berkhof_duvedec/berkhof_duvedec_lod_0_w2.msh", "vehicle/bus/berkhof_duvedec/berkhof_duvedec_lod_0_w3.msh", Ausgabe Code: (dl
)
1 $ perl paths.pl OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/) -- Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html Perl-Entwicklung: http://perl-services.de/ |