If there were any hair left on my 20 year old head, I'd still be pulling them out...good thing for me I pulled the last hairs out last night over this!

I'm parsing a page that looks:

Chat at Allpoetry.com 400 MB hosting with 5 GB traffic for $4.95 per m +onth. Domain registration for $9.95. Hello. Login or Register? PoemsP +oetsContestsColumnsClassAdd linesFunBulletinStoreHelp Chatter Archive +s< Previous Chatter | Next Chatter >malevolent angel: if you +look closer, there are more than mods not doing anything in this chat +terbox.....hell, i use to not even come near to it lol (11 minute +s ago) demonwithin: ~coulda sworn he was drinking from goddess (11 minute +s ago) sprkls926: *hits him in the side* get off (11 minutes ago) JurneesRainbow: check out contest: the enviroment!!!!!!!!!!! (11 m +inutes ago) Foretold-Events: Well I wonder about those things hehe (12 minutes + ago) sprkls926: hey (12 minutes ago) < Previous Chatter | Next Chatter > Featured Thank Youby Rube +eIf Not For Youby CinaraSweet Rain (for Rubee) by WolfbaneStarbuck colonicby Barbara DavidsonBorrowed Bracelet (hope +you don't mind) by mystysaintmanage featured Chatterbox sprkls926: *kicks him again*de +monwithin: ~pulls out the blade and flings it to the floor splatterin +g sparkls with his blood~ take it up and do your worstmalevolent ange +l: *enjoys the show from the shadows*demonwithin: ~spreads his arms l +ike hes cruxified~sprkls926: *trys to back away from him*demonwithin: + strike if you may sprkls Online [101] ForgottenAn.. mystysaint symit +ar Zez 216 visitorsshow all A network of sharing: All Poetry, Story W +rite, All Philosophy, Old Poetry.
It took a day but finally I was able to line break where I needed to (after each set of ( .. ). But as you can see, there are things before and after the nice line breaks (the "Chat at Allpoetry.com 400 MB hosting with 5 GB traffic for $4.95 per month" lines and "< Previous Chatter | Next ". I tried using:
for my $lines (@lines ) { if ($lines =~ s/\)/\)<br>/g) { push @good,$lines; } } @lines = @good; print "@good";
Hoping to remove ANYTHING my line breaks didn't alter or find, but that didn't work and everything still prints out (all the junk ads). The $lines =~.. is what I need and use to line break, does anyone know a method to get rid of everything else?

In reply to html parsing/regex by coldfingertips

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.