in reply to Using Perl to snip the end off of HTML
_______________________________________________
Web4lib mailing list
added> In fact, the more I puzzle over this, the more I suspect that despite your certainty about your intent (as indicated by your caution to 'hold all "Why would you want to do that?" responses.' may reflect inadequate analysis of what you need to do to achieve your (still vague) objective.
added> Others, more skilled, may approach this differently, but IMO, writing complex regexen is only about 10% knowing syntax; the rest is analysing your dataset so that the logic of the regex is plain. So, consider writing (or at least, 'thinking through') a detailed example of what output you want from the processing and compare that -- in detail -- to the source, to get a clear view of what you need to do.
And again: This clearly is a case where you'll ascend unto the heavens more quickly and surely on the backs of those who've written "gold standard" modules as HTML::Parser, etc. than by re-inventing the wheel.
By way of confession; writing the regex you're seeking is not quite as simple as I suggested above for your source example,
... but ...
update Last 2 bullets and the 2 following paragraphs added (2005 Jun 8 2100 GMT), after 'puzzling' for a bit.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using Perl to snip the end off of HTML
by eastcoastcoder (Sexton) on Jun 08, 2005 at 23:09 UTC |