Re: WebDNA Grep help wanted

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 56183
interpreted = N
texte = I see why you require pairs, but that makes the grep much harder because, in the example you give, the search ends at the first [ when it should end at the first [/b. One work-around is to try: grep search=\[([unurl]%5B[/unurl])(iIbB)\]&replace=<\1\2> I'm not completely sure of the sytax without testing, but the general idea is to match either [b] or [/b] to replace with or in the same expression so that each instance is treated and not a pair of tags. Another way might be to bypass the first [i but I don't know how to not match a pattern in grep, only single characters as you've done: grep search=\[[bB]\]([NOT THE CLOSING TAG PATTERN THAT FOLLOWS]*)\[/[bB]\] Bill -----Original Message----- From: Palle Bo Nielsen Sent: Tue, 17 Feb 2004 21:44:26 +0100 To: (WebDNA Talk) Subject: WebDNA Grep help wanted Hi all, I have a messageboard developed in WebDNA. The messageboard does not accept HTML syntax due to security. In stead I have made a parsingt system which translate forum specific tags to HTML behind the scenes. [/b]If I wanted to post a message in the forum with bold words it would look like this[/b] [/i]If I wanted to post a message in the forum with italic words it would look like this[/i] The grep lines handling this process is pasted below, but it can't handle a line like this. And here I need some help... [b] this is a line of bold words including one word in [i]italic[/i], but it won't work - only the italic-tags are parsed correctly[/b] Any help is appreciated... ----- code ---- [!] -- REPLACE [b] WITH (ignore case) text [/!] [text]the_text=[grep search=\[[bB]\]([^[unurl]%5B[/unurl]]*)\[/[bB]\]&replace=\1][text]the_text[/text][/grep][/text] [!] -- REPLACE [b] WITH (ignore case) text [/!] [text]the_text=[grep search=\[[iI]\]([^[unurl]%5B[/unurl]]*)\[/[iI]\]&replace=\1][text]the_text[/text][/grep][/text] ----- code ---- There are lots of other Greps parsing syntax but I only include the above for this example. Palle ------------------------------------------------------------- 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://webdna.smithmicro.com/ ------------------------------------------------------------- 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://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: WebDNA Grep help wanted ( Kenneth Grome 2004)
  2. Re: WebDNA Grep help wanted ( Gary Krockover 2004)
  3. Re: WebDNA Grep help wanted ( Kenneth Grome 2004)
  4. Re: WebDNA Grep help wanted ( William DeVaul 2004)
  5. Re: WebDNA Grep help wanted ( Kenneth Grome 2004)
  6. Re: WebDNA Grep help wanted ( Gary Krockover 2004)
  7. Re: WebDNA Grep help wanted ( devaulw@onebox.com 2004)
  8. Re: WebDNA Grep help wanted ( devaulw@onebox.com 2004)
  9. Re: WebDNA Grep help wanted ( "Andrew Simpson" 2004)
  10. Re: WebDNA Grep help wanted ( Palle Bo Nielsen 2004)
  11. Re: WebDNA Grep help wanted ( "Andrew Simpson" 2004)
  12. WebDNA Grep help wanted ( Palle Bo Nielsen 2004)
I see why you require pairs, but that makes the grep much harder because, in the example you give, the search ends at the first [ when it should end at the first [/b. One work-around is to try: grep search=\[([unurl]%5B[/unurl])(iIbB)\]&replace=<\1\2> I'm not completely sure of the sytax without testing, but the general idea is to match either [b] or [/b] to replace with or in the same expression so that each instance is treated and not a pair of tags. Another way might be to bypass the first [i but I don't know how to not match a pattern in grep, only single characters as you've done: grep search=\[[bB]\]([NOT THE CLOSING TAG PATTERN THAT FOLLOWS]*)\[/[bB]\] Bill -----Original Message----- From: Palle Bo Nielsen Sent: Tue, 17 Feb 2004 21:44:26 +0100 To: (WebDNA Talk) Subject: WebDNA Grep help wanted Hi all, I have a messageboard developed in WebDNA. The messageboard does not accept HTML syntax due to security. In stead I have made a parsingt system which translate forum specific tags to HTML behind the scenes. [/b]If I wanted to post a message in the forum with bold words it would look like this[/b] [/i]If I wanted to post a message in the forum with italic words it would look like this[/i] The grep lines handling this process is pasted below, but it can't handle a line like this. And here I need some help... [b] this is a line of bold words including one word in [i]italic[/i], but it won't work - only the italic-tags are parsed correctly[/b] Any help is appreciated... ----- code ---- [!] -- REPLACE [b] WITH (ignore case) text [/!] [text]the_text=[grep search=\[[bB]\]([^[unurl]%5B[/unurl]]*)\[/[bB]\]&replace=\1][text]the_text[/text][/grep][/text] [!] -- REPLACE [b] WITH (ignore case) text [/!] [text]the_text=[grep search=\[[iI]\]([^[unurl]%5B[/unurl]]*)\[/[iI]\]&replace=\1][text]the_text[/text][/grep][/text] ----- code ---- There are lots of other Greps parsing syntax but I only include the above for this example. Palle ------------------------------------------------------------- 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://webdna.smithmicro.com/ ------------------------------------------------------------- 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://webdna.smithmicro.com/ devaulw@onebox.com

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:

OT: Web Cams (2003) createfolder not behaving as expected (1999) wo search help (1999) any suggestions for creating a multi-lingual site? (1999) creating an email message (1998) Exporting a blank record (2000) [WebDNA] WARNING Do not upgrade to OS X Server 5.04 (2015) where to put code (1998) Can you do this??? and other stuff (1997) Items XX to XX shown (1997) Search Sort Random (2004) WebCat2: Items xx to xx shown, etc. (1997) default value from Lookup (1997) [WebDNA] [WSC] WebDNA Development Summit (2014) [OT] Imagemagick (2004) HELLO (2000) Adding Multiple files to a cart at once (1998) triggering an update of two frames (1998) problems with 2 tags shakur (1997) retain raw [cart] submitted value (2004)