in reply to pattern matching

First: It is really not recomended to use regex to parse htlm (tends to turn into a nightmare).

Second: You need to use the s modifier on your regex in order to make . match the newline character.

Third: using .+ is greedy, and will match from the first <!-- Start_of_revision--> to the last <!-- End_of_revision--> (which I am sure is not what you want).

Forth: The code below is untested

@revision_array=(); my $start = qr/<!-- Start_of_revision-->/; my $end = qr/<!-- Start_of_revision-->/; if (m/$start((?:(?!$end).)+)$end/msg) { push (@revision_array, $1); }

Update: And to get all of them, that if should be a while


They say that time changes things, but you actually have to change them yourself.

—Andy Warhol