Greetings monks

I am having some problems with pattern matching.

I need to generate some perl that searches through an html document to find snippets of text delimited by two strings, and to assign anything between these two delimiting strings to an array.
The snippets of text are spread over 4 lines.
The opening delimiter is <!-- Start_of_revision--> on the first line, and the closing delimiter is <!-- End_of_revision-->, on the fourth line.
There can multiple instances of this 4-line snippet in an html document, and each time I detect one of these instances, I would like to put anything between the delimiters into an array, thus building up a list of revisions.

I have tried:

@revision_array=(); if (m/<!-- Start_of_revision-->(.+)<!-- End_of_revision-->/mg) { push (@revision_array, $1); }

But alas, nothing is detected. I'm guessing this is a hopelessly naive approach, but I really haven't got the time to work it out myself, so I was wondering if you guys could help me out?

C J


In reply to pattern matching by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.