Hi Tom,

sorry i was missing to tell, that i used the HERE script like syntax.

Here's an example:

------------------------------------

#!/usr/bin/perl -w

use strict;

my $input = << "END_OF_INPUT";
Hi there!
Here're some lines to match...
1st some specific ones
some more
and finally this one
Now the list
A Headline
1   2   3  4   5
6   7   8  9  10
11 12  13 14  15

Some final line
END_OF_INPUT

printf ("### the input is <$input>###\n");

my $parser = << "END_OF_PARSER";
Hi there!
Here're some lines to match...
1st some (specific) ones
some more
and finally this one
Now the list
A (Headline)
(?:(\\d+)[ ]+(\\d+)[ ]+(\\d+)[ ]+(\\d+)[ ]+(\\d+)\\n)*
Some final line
END_OF_PARSER

if ($input !~ $parser) {
        die "input does NOT match parser";
}

my @values = ($input =~ $parser);

printf ("extracted values (" . scalar(@values) . "):\n");
foreach (@values) {
        printf ("\t$_\n");
}
printf ("\n");

------------------------------------

It just prints:

### the input is <Hi there!
Here're some lines to match...
1st some specific ones
some more
and finally this one
Now the list
A Headline
1   2   3  4   5
6   7   8  9  10
11 12  13 14  15

Some final line
>###
extracted values (7):
        specific
        Headline
        11
        12
        13
        14
        15

I.e. only the last line, that matched for #5 numbers

rgds!

Frank


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to