Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   Removing whitespace and quotes from the end of HTML (http://www.velocityreviews.com/forums/t892762-removing-whitespace-and-quotes-from-the-end-of-html.html)

unknownsoldier93@yahoo.com 06-09-2005 01:26 AM

Removing whitespace and quotes from the end of HTML
 
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?


A. Sinan Unur 06-09-2005 02:04 AM

Re: Removing whitespace and quotes from the end of HTML
 
unknownsoldier93@yahoo.com 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 <1usa@llenroc.ude.invalid>
(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

unknownsoldier93@yahoo.com 06-09-2005 02:31 AM

Re: Removing whitespace and quotes from the end of HTML
 
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... :)


A. Sinan Unur 06-09-2005 03:17 AM

Re: Removing whitespace and quotes from the end of HTML
 
unknownsoldier93@yahoo.com wrote in news:1118284291.948822.239080@g14g2000cwa.googlegr 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

socialism001@yahoo.com
unknownsoldier93@yahoo.com
abracad_1999@yahoo.com

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 <1usa@llenroc.ude.invalid>
(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

unknownsoldier93@yahoo.com 06-09-2005 04:17 AM

Re: Removing whitespace and quotes from the end of HTML
 
Yes, Ithaca is gorgeous.


unknownsoldier93@yahoo.com 06-09-2005 04:20 AM

Re: Removing whitespace and quotes from the end of HTML
 
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).


unknownsoldier93@yahoo.com 06-09-2005 02:37 PM

Re: Removing whitespace and quotes from the end of HTML
 
Bickering aside, can anyone help me with this? Perl experts, where are
you?


Jürgen Exner 06-10-2005 05:31 AM

Re: Removing whitespace and quotes from the end of HTML
 
unknownsoldier93@yahoo.com 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




All times are GMT. The time now is 12:36 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.