C
Charles DeRykus
On 8/13/2013 12:05 AM, (e-mail address removed) wrote:
...
I think Ben's suggestion is the most promising if you want to identify
the sentences over which the match extends:
while (my ($match) =
$alles =~ /([^\n]* \d .* Zahl [^\n]*)/gsx
# or perhaps /(.* \d (?s:.)* Zahl .*)/gx
# or /(\N* \d .* Zahl \N*)/gsx if you've got 5.12
) {
for my $satz (split /\n/, $match) {
# make that /(?<=\n)/ if you don't want to chomp
print "sentence is part of match: $satz\n\n";
}
}
Also, to take care of the endless loop problem:
while (my ($match) =$alles =~ /([^\n]* \d .* Zahl [^\n]*)/gsx ) {
Replace above with:
for my $match ($alles =~ /([^\n]* \d .* Zahl [^\n]*)/gsx/) {