Hi Guys! Had a favor (again!) to ask of you smart people - I have two problems:
1. I have a HTML page in the form -
JUNK JUNK
NAME NAME
PANE
And I want to extract the "NAME NAME" part only (not the stuff above or below NAME NAME either). How would I go about doing that. I tried some RegEx like
m/(.*)PANE\s*([^<]+)/gi; but that didn't work. Any thoughts? BTW "PANE" is the keyword which is always there.... the NAME NAME changes.
2. I have the same html page, which has a lot of text, but will also has a website URL (not a hyperlink) surrounded by either a "" or a < > and I want to extract it. Thing is that when the < > is there I can get the URL easily, but when I do a RegEx for finding the url in a "", I get the other content on the page which is also in quotes.
Any help would be appreciated.
Thanks.
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.