Re: [WebDNA] remove html comments
This WebDNA talk-list message is from 2009
It keeps the original formatting.
numero = 101818
interpreted = N
texte = Owkaye Go wrote:>> (just under 800 lines) and used:>> and it successfully parsed out all the> > I think you say is correct and original answer > wrong. I will test and report my results. Can you> explain why .* is fail but [^-]* success?I didn't say it was correct, I said it will work most of thetime. In the "second answer", we are looking for a string matchthat starts with and does not have"-" in between it. So it will fail, for example, with nestedcomments, or comments that contain a dash for some reason, or perhaps other formats. However, it is probable that it will work formost people, most of the time. If you are one that uses "-"as a convention in comments, you will have to change the code.Regarding why .* fails, I don't know exactly. traditionallythe "." character doesn't work past lines and the "*" characteris "greedy" (you'll have to look that up, because this isnot a regular expression forum). So, the .* should not workat all for this purpose. However, since WebDNA's grep implementationis not POSIX standard, and is a hybrid of sorts, it appeared to workin my quick test that I did before I originally posted... parsing more than one line. A further test showed that it does not work consistently.A yet further test showed that it does not appear to be"capacity limit" thing.Frankly, my real answer is neither "solution". I don'tthink regular expressions (in WebDNA's grep, or POSIX regex) is the"sure-fire" answer to this problem. However, one could probablybuild a more thorough regex call (I'd probably call the POSIXregex with [shell] via sed (find/replace) rather than use WebDNA'shybrid grep which is not yet well documented) that would bemore versatile and robust, but I think the real answer probablylies in a tried and tested module/function somewhere..probablycallable from WebDNA's [SHELL] or what-have-you. Though WebDNAcould indeed be the solution for such a problem, *existing* modules are usually the result of many years of work by more than one person,which makes it worth checking out the third party solution.For a solution in WebDNA, I guess I'd start building a parser.. perhapsusing listwords and other tools. However, it could be a long rodeto get something solid. Since it is not easily done, WSC may lookinto this to see if something could be done with removehtml...[removehtml comments] or something. This may be worth the effortbecause it is something that comes up in our line of work occasionally.However, it would fall back on the priority list quite a ways.Donovan-- =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o DONOVAN D. BROOKE Pres., EUCA Design Center
WEB:> http://www.euca.us =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o
Associated Messages, from the most recent to the oldest:
Owkaye Go wrote:>> (just under 800 lines) and used:>> and it successfully parsed out all the> > I think you say is correct and original answer > wrong. I will test and report my results. Can you> explain why .* is fail but [^-]* success?I didn't say it was correct, I said it will work most of thetime. In the "second answer", we are looking for a string matchthat starts with and does not have"-" in between it. So it will fail, for example, with nestedcomments, or comments that contain a dash for some reason, or perhaps other formats. However, it is probable that it will work formost people, most of the time. If you are one that uses "-"as a convention in comments, you will have to change the code.Regarding why .* fails, I don't know exactly. traditionallythe "." character doesn't work past lines and the "*" characteris "greedy" (you'll have to look that up, because this isnot a regular expression forum). So, the .* should not workat all for this purpose. However, since WebDNA's grep implementationis not POSIX standard, and is a hybrid of sorts, it appeared to workin my quick test that I did before I originally posted... parsing more than one line. A further test showed that it does not work consistently.A yet further test showed that it does not appear to be"capacity limit" thing.Frankly, my real answer is neither "solution". I don'tthink regular expressions (in WebDNA's grep, or POSIX regex) is the"sure-fire" answer to this problem. However, one could probablybuild a more thorough regex call (I'd probably call the POSIXregex with [shell] via sed (find/replace) rather than use WebDNA'shybrid grep which is not yet well documented) that would bemore versatile and robust, but I think the real answer probablylies in a tried and tested module/function somewhere..probablycallable from WebDNA's [shell] or what-have-you. Though WebDNAcould indeed be the solution for such a problem, *existing* modules are usually the result of many years of work by more than one person,which makes it worth checking out the third party solution.For a solution in WebDNA, I guess I'd start building a parser.. perhapsusing listwords and other tools. However, it could be a long rodeto get something solid. Since it is not easily done, WSC may lookinto this to see if something could be done with removehtml...[removehtml comments] or something. This may be worth the effortbecause it is something that comes up in our line of work occasionally.However, it would fall back on the priority list quite a ways.Donovan-- =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o DONOVAN D. BROOKE Pres., EUCA Design Center WEB:> http://www.euca.us =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o
Donovan Brooke
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
[WriteFile] problems (1997)
[body_include] (2001)
NumFound (1999)
F3 crashing server (1997)
Me know logical no need (2002)
I've been thinking (2002)
Expert tech support -- a fast and simple solution (long) ... (2000)
WebCat B13 Mac CGI -- Frames question (1997)
POS (2000)
WebCatalog2 Feature Feedback (1996)
Remove WebDNA context (2001)
FEW QUESTIONS (1997)
WebCat2 - [format thousands] (1997)
how to use WebCat w. SSL & CyberCash (1998)
HomePage Caution (1997)
WebCat editing, SiteGuard WAS:SiteAssociative lookup style? (1997)
Concealing WebCatalog in the URL (2000)
Setting up shop (1997)
WebCatalog 4.0.1b1 is now available (2000)
So many lookers, hey smith micro (2003)