Re: Grep and convertchars

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 53866
interpreted = N
texte = You could wrap the entire grep context in the convertchars: [convertchars db=3Dchangemail.db][grep ...]thetext[/grep][/convertchars] ....but that would convertchars on the full text, not just the email =20 addresses. The solution may be to embed the convertchars context in the grep =20 output, then interpret the whole thing: [interpret][grep search=3D...&replace=3D[url]%5Bconvertchars =20 db=3Dchangemail.db%5D\1%5B/convertchars%5D[/url]]thetext[/grep][/=20 interpret] This grep will result in (if I got the code right) something like: blah blah [convertchars db=3Dchangemail.db]bob@bob.com[/convertchars] =20= blah blah ....then the interpret will process the convertchars context. You need to be sure that the rest of the text doesn't contain any DNA =20= code that would also get executed by the interpret and may cause damage. - brian On Thursday, November 6, 2003, at 05:45 AM, Nitai @ ComputerOil wrote: > Hi all > > Somehow I cant get grep to work properly. > > I need to change every email address on a text and convert it. So =20 > doing a: > > [grep search=3D([A-z0-9_\-\.]*@[A-z0-9_\-\.][A-z0-9_\-\.]*)&replace=3D\1= ] > > Works fine. But then when trying to use this: > > [grep > search=3D([A-z0-9_\-\.]*@[A-z0-9_\-\.][A-z0-9_\-=20 > \.]*)&replace=3D[ConvertChars > db=3Dchangemail.db]\1[/ConvertChars]] > > It fails. I guess my logic behind this fails, right? WebDNa can not be = =20 > used > on a grep pattern or alike. > > Any other solution? I need to find every email address in a text and =20= > change > it. I thought grep would do the job. > > Nitai > > -- > Redakto - Content Management that simply works > > ComputerOil=AE GmbH > Unionstrasse 4 > 8032 Z=FCrich / Switzerland > Telefon +41 (0)844 44 55 66 > > info@computeroil.com > http://computeroil.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 =20 > > 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: Grep and convertchars ( Brian Fries 2003)
  2. Re: Grep and convertchars ( devaulw@onebox.com 2003)
  3. Grep and convertchars ( "Nitai @ ComputerOil" 2003)
You could wrap the entire grep context in the convertchars: [convertchars db=3Dchangemail.db][grep ...]thetext[/grep][/convertchars] ....but that would convertchars on the full text, not just the email =20 addresses. The solution may be to embed the convertchars context in the grep =20 output, then interpret the whole thing: [interpret][grep search=3D...&replace=3D[url]%5Bconvertchars =20 db=3Dchangemail.db%5D\1%5B/convertchars%5D[/url]]thetext[/grep][/=20 interpret] This grep will result in (if I got the code right) something like: blah blah [convertchars db=3Dchangemail.db]bob@bob.com[/convertchars] =20= blah blah ....then the interpret will process the convertchars context. You need to be sure that the rest of the text doesn't contain any DNA =20= code that would also get executed by the interpret and may cause damage. - brian On Thursday, November 6, 2003, at 05:45 AM, Nitai @ ComputerOil wrote: > Hi all > > Somehow I cant get grep to work properly. > > I need to change every email address on a text and convert it. So =20 > doing a: > > [grep search=3D([A-z0-9_\-\.]*@[A-z0-9_\-\.][A-z0-9_\-\.]*)&replace=3D\1= ] > > Works fine. But then when trying to use this: > > [grep > search=3D([A-z0-9_\-\.]*@[A-z0-9_\-\.][A-z0-9_\-=20 > \.]*)&replace=3D[ConvertChars > db=3Dchangemail.db]\1[/ConvertChars]] > > It fails. I guess my logic behind this fails, right? WebDNa can not be = =20 > used > on a grep pattern or alike. > > Any other solution? I need to find every email address in a text and =20= > change > it. I thought grep would do the job. > > Nitai > > -- > Redakto - Content Management that simply works > > ComputerOil=AE GmbH > Unionstrasse 4 > 8032 Z=FCrich / Switzerland > Telefon +41 (0)844 44 55 66 > > info@computeroil.com > http://computeroil.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 =20 > > 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/ Brian Fries

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:

Re:Variable Math (1998) [OT] Unix question -solution?- (2002) WC 2.0 frames feature (1997) formula??? (2000) PCS Frames (1997) HTML Editors (1997) Nested tags count question (1997) Listserver problem (1997) Getting Emailer to send mail (1997) Database Repopulation (2004) New command suggestion (1997) New public beta available (1997) Preventing code execution (2003) Summary layout (1997) Summing fields (1997) WC2b15 File Corruption (1997) RequiredFields notes ... (1997) Error with [applescript] (1999) [ot] Any One Want A WebDNA Billing Program? (2003) Issues with the default db files ... (2003)