Hamish Whittal wrote:
(Example 1)
I have the following lines:
This is some text....<B
luebird>..MBAAAEgAAAQAB
blaah,blaah
=+=+=+=+=+=+=+=+=+=+=+

(Example 2)
but sometimes it looks like this:
This is some text....<Bluebird>..
MBAAAEgAAAQAoBAAAQKAREDSCETRTBDFS
blaah,blaah
=+=+=+=+=+=+=+=+=+=+=+

Now, given this, I am wanting to skip over the text when I find it
(bounded by <Bluebird> and =+=+=+)

So, I have a loop as follows:
LINE: while ( <> ) {
        next LINE if (m/\.{4}<B.*ird>/s .. /(\+\=\+)$/);
        print;
}

The "next" works fine if the <Bluebird> tag is not split as in
example (2) above, but fails when the <Bluebird> tag is split as in
example (1) above.

Can anyone show me what I am doing wrong.

Hard to tell, since you didn't post a complete program + sample data that illustrates your problem. Can it possibly be that you need to make the first regex non-greedy?

    /\.{4}<B.*?ird>/s
--------------^

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

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




Reply via email to