I
Indigo5
I need a way of parsing a variable format. Basically the section starts off
with a Reference keyword and ends with a Comments keyword.
Reference:
1. document1
2 document2
Comments:
I was doing this as follows:
if (/^Reference/ .. /^Comments/){
if (/^[0-9]/){
chomp;
$_ =~ s/^[0-9].\s+//g;
push @references, $_;
}
}
However, I just received a document where Reference 1 wrapped onto another
line so that the format looks like this:
Reference:
1. document 1
more of document 1 here
2. document 2
Comments:
I cannot change the format of the input I receive, so I have to find a way
to parse this the way I receive it. Any help would be highly appreciated.
Thank you.
with a Reference keyword and ends with a Comments keyword.
Reference:
1. document1
2 document2
Comments:
I was doing this as follows:
if (/^Reference/ .. /^Comments/){
if (/^[0-9]/){
chomp;
$_ =~ s/^[0-9].\s+//g;
push @references, $_;
}
}
However, I just received a document where Reference 1 wrapped onto another
line so that the format looks like this:
Reference:
1. document 1
more of document 1 here
2. document 2
Comments:
I cannot change the format of the input I receive, so I have to find a way
to parse this the way I receive it. Any help would be highly appreciated.
Thank you.