Thread Probleme mit RegEx und Worttypen
(49 answers)
Opened by Dingels at 2008-07-25 19:00 Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 use strict; use warnings; use Data::Dumper; my %hash = ('Abend' => 'NN', 'Sonne' => 'NN', 'Haus' => 'NN', ); my $text="Haus Abendsonne haussonne hurz"; my $words_re= join '|', keys %hash; my @komposita= $text =~ m/\b(?:$words_re)(?:$words_re)\b/gi; print Dumper \@komposita; $VAR1 = [ 'Abendsonne', 'haussonne' ]; me and my writeups
|