Re: quick GREP question
This WebDNA talk-list message is from 2001
It keeps the original formatting.
numero = 39562
interpreted = N
texte = John Peacock wrote:> Steven Jarvis wrote:>>>> I know jack about grep, though I'm planning to learn it. I *think* >> it's what>> I want to use in this situation, but I'm open to any other options, >> too.>> Get Mastering Regular Expressions from O'Reilly (ISBN 1-56592-257-2).> Ignore all of the discussion of Perl extensions to regex engines (it> will just make you jealous ;~) since the WebCat grep is pretty basic.Thanks for the tip. I use other languages than WebCat where I'm needing to learn regex, too, so it should help all around.>> I have to format some stories with WebCat and export them to a text >> file,>> and I need to cut some HTML tags and their contents out of stories if >> they>> are present.>>>> Can I call your attention to the following context which is designed> specifically for your problem:>> http://betadoc.smithmicro.com/RemoveHTMLContext.htmlI started there, actually, but I thought I had found a couple of situations where I would be removing more than just tags, but also content between them that would be out of place/context with the tags gone. There aren't too many of them, though, so I can probably get around that.> In general, you cannot use [grep] to always strip out markup tags,> due to line breaks and nesting. You really need to have a simple> state machine to correctly parse nested HTML tags; if you can make> certain assumptions about your tags, you can deal with it with grep,> but you need to be very careful.>There are assumptions I can make about these particular tags, as they always start with the same tag, ID, and class info. I'll poke around in the book and see what I can come up with.Thanks,Steven-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
.To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/
Associated Messages, from the most recent to the oldest:
John Peacock wrote:> Steven Jarvis wrote:>>>> I know jack about grep, though I'm planning to learn it. I *think* >> it's what>> I want to use in this situation, but I'm open to any other options, >> too.>> Get Mastering Regular Expressions from O'Reilly (ISBN 1-56592-257-2).> Ignore all of the discussion of Perl extensions to regex engines (it> will just make you jealous ;~) since the WebCat grep is pretty basic.Thanks for the tip. I use other languages than WebCat where I'm needing to learn regex, too, so it should help all around.>> I have to format some stories with WebCat and export them to a text >> file,>> and I need to cut some HTML tags and their contents out of stories if >> they>> are present.>>>> Can I call your attention to the following context which is designed> specifically for your problem:>> http://betadoc.smithmicro.com/RemoveHTMLContext.htmlI started there, actually, but I thought I had found a couple of situations where I would be removing more than just tags, but also content between them that would be out of place/context with the tags gone. There aren't too many of them, though, so I can probably get around that.> In general, you cannot use [grep] to always strip out markup tags,> due to line breaks and nesting. You really need to have a simple> state machine to correctly parse nested HTML tags; if you can make> certain assumptions about your tags, you can deal with it with grep,> but you need to be very careful.>There are assumptions I can make about these particular tags, as they always start with the same tag, ID, and class info. I'll poke around in the book and see what I can come up with.Thanks,Steven-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/
Steven Jarvis
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:
FW: Shipping calculations (1997)
WebCat2 - [SendNews] (1997)
WebCat2b15MacPlugin - [protect] (1997)
quit sending me mail!!!!! (1999)
Filling in fields conditionally (1998)
HomePage Caution (1997)
Max Record length (1997)
Country & Ship-to address & other fields ? (1997)
[ShowIf] and empty fields (1997)
[WebDNA] bitly url shortener integration (2016)
[OT] Read and weep (2003)
[WebDNA] Authorize.net and [tcpconnect] (2016)
[OT] Stuff (2002)
Associative lookup style? + bit more (1997)
Re:[off] Promotions Co? (1997)
WebCatalog 4.0 Users that want to talk to the Media.... (2000)
BBEdit/HTMLcomments/WebCat/[/FONT] (1999)
serial number generation (1997)
Missing from Docs [folderName] (1997)
Email and name capture (1999)