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:
Merchant account (1998)
WebCat2b13MacPlugIn - [include] doesn't allow creator (1997)
WebDNS and RSS (2003)
Cookie Crumble (1998)
japanese characters (1997)
WebCatalog/Mac 2.1b2 New Features (1997)
WebCat2 several catalogs? (1997)
[LOOKUP] (1997)
what characters are replaced for tab and CR? (1998)
Ports? (2002)
WebMerchant? (1998)
Viewing old carts (was FEW QUESTIONS) (1997)
Doing VALIDCARD right? (1998)
Great product and great job ! (1997)
OT Weird Messenger Service message (2002)
NT version and O'reily's WebSite (1997)
reserved characters for field names? (1998)
[WebDNA] Error 500 with SUMM=T (2017)
why am I getting an authenticate dialog with no [protect]? (2000)
japanese characters (1997)