1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| #!/usr/bin/perl
use warnings;
use strict;
my @chaine = (
'nom_du_fichier_trouve1.xml:<CM><CA>86767</CA>564654<LV>54654<I>897987897<Q>987</Q><Q>48</Q></I></LV></CM>',
'nom_du_fichier_trouve2.xml:<CM><CA>7786786</CA>86768<LV>5656<I>5656<Q>96</Q><Q>65</Q></I></LV><LV>656568<I>5656<Q>96</Q><Q>65</Q></I></LV></CA></CM>',
);
foreach my $data ( @chaine ) {
my @motif = $data =~ m{(<i>.+?</i>)}msgi;
print "==========\n";
print "CHAINE : $data\n";
print "Motif : @motif\n";
print "==========\n";
} |