This shows up older than the other answers on the original Q &: A question
Apply regex to entire file, not just individual lines ? that's because I've been trying to get it posted all afternoon.
Ok Q & A isn't really designed to give you the
kind of help you're looking for. Since you haven't
logged in I can't contact you directly, but I've moved
this to Seekers of Perl Wisom.
You asked
I'm trying to extract a specific block of recurring
text from a daily-updated Web page, and output the
result to a local file. I'm happy with my HTML
retrieval, but then applying regex's on a line-by-line
basis requires waaay too much tweeking on my part. How
can I substitute across multiple lines? Preferably to
the entire file.
See my answer below, I'm having real problems posting this question
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.