Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Removing whitespace and quotes from the end of HTML

Reply
Thread Tools

Removing whitespace and quotes from the end of HTML

 
 
unknownsoldier93@yahoo.com
Guest
Posts: n/a
 
      06-09-2005
Hi. I'd like to use Perl to remove off the end of HTML any whitespace.
A simple s/\s*$//s won't suffice, since, in HTML, whitespace can look
like <pre> </pre> or &nbsp; etc.

(The HTML is stored in a local perl $variable.)

Also, I'd like to remove any <blockquote>blah blah blah</blockquote> at
the END of the document ONLY (ie, but not from the middle of the page).
Again, a simple s/<blockquote.*?\/blockquote>$//s won't suffice, since
blockquotes can be nested.

Any ideas?

 
Reply With Quote
 
 
 
 
A. Sinan Unur
Guest
Posts: n/a
 
      06-09-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote in news:1118280417.715640.184880
@g44g2000cwa.googlegroups.com:

> Hi. I'd like to use Perl to remove off the end of HTML any whitespace.


....

> Also, I'd like to remove any <blockquote>blah blah blah</blockquote>


....

> Any ideas?


You are supposed to check the FAQ before you post a question.

Besides, what's up with posting half a dozen FAQs each using a different
email address?

Sinan
--
A. Sinan Unur <(E-Mail Removed)>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/cl...uidelines.html
 
Reply With Quote
 
 
 
 
unknownsoldier93@yahoo.com
Guest
Posts: n/a
 
      06-09-2005
I think you are confusing me with someone else. This is my first post.
These issues are not discussed in the FAQ - read them carefully (they
seem simple, but the complications make them quite difficult - I have
been programming Perl for over 5 years and am having trouble.)

(It's okay, I know Cornell can be a stressful place and so you need an
outlet...

 
Reply With Quote
 
A. Sinan Unur
Guest
Posts: n/a
 
      06-09-2005
(E-Mail Removed) wrote in news:(E-Mail Removed) oups.com:

[ Please quote some context when you are replying. ]

> I think you are confusing me with someone else.


Maybe.

But the style used in the posts by

(E-Mail Removed)
(E-Mail Removed)
(E-Mail Removed)

are very similar in style and attitude.

> This is my first post.


In that case, you should definitely consult the posting
guidelines for this group.

> These issues are not discussed in the FAQ - read them carefully


Really?

<URL: http://theoryx5.uwinnipeg.ca/CPAN/perl/pod/perlfaq9/How_do_I_remove_HTML_from_a_string.html>

>(they seem simple, but the complications make them quite difficult -
> I have been programming Perl for over 5 years and am having trouble.)


You'll need to put together some code. It shouldn't be too hard to put
together some code using CPAN modules and ask questions here if you run
into problems.

> (It's okay, I know Cornell can be a stressful place and so you need an
> outlet...


Actually, the students have left, and summer has finally arrived in Ithaca,
so I have ample time to relax by the lake, or the many gorges.

Sinan
--
A. Sinan Unur <(E-Mail Removed)>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/cl...uidelines.html
 
Reply With Quote
 
unknownsoldier93@yahoo.com
Guest
Posts: n/a
 
      06-09-2005
Yes, Ithaca is gorgeous.

 
Reply With Quote
 
unknownsoldier93@yahoo.com
Guest
Posts: n/a
 
      06-09-2005
About the FAQ - Please read my question *carefully*. Yes, I know about
regexes and HTML Parser. My difficulty is with *nested* blockquotes,
combined with the fact that I only want to remove them if they are at
the end (not including any whitespace or html whitespace).

 
Reply With Quote
 
unknownsoldier93@yahoo.com
Guest
Posts: n/a
 
      06-09-2005
Bickering aside, can anyone help me with this? Perl experts, where are
you?

 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      06-10-2005
(E-Mail Removed) wrote:
> Bickering aside, can anyone help me with this? Perl experts, where
> are you?


Help with what?
Please quote enough context such that people have a chance to know what you
are talking about.

jue


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Splitting text at whitespace but keeping the whitespace in thereturned list MRAB Python 3 01-26-2010 11:36 PM
Structure using whitespace vs logical whitespace cmdrrickhunter@yaho.com Python 10 12-16-2008 03:51 PM
Asp.NET Javascript string, want to pass '(single quotes' within '(single quotes) Chris ASP .Net 1 03-24-2006 09:03 PM
Whitespace where I don't want whitespace! Oli Filth HTML 9 01-17-2005 08:47 PM
Quotes/Double Quotes in Image Control Chris White ASP .Net 1 09-22-2004 06:22 AM



Advertisments