coldfingertips has asked for the wisdom of the Perl Monks concerning the following question:
I'm parsing a page that looks:
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: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.
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?for my $lines (@lines ) { if ($lines =~ s/\)/\)<br>/g) { push @good,$lines; } } @lines = @good; print "@good";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: html parsing/regex
by artist (Parson) on Jul 30, 2003 at 19:54 UTC | |
by coldfingertips (Pilgrim) on Jul 30, 2003 at 21:12 UTC |