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:

Follow-up to listfiles bug report ... (2003) [WebDNA] Host List (2010) Serial Number Question (1997) Replacing a Word (1999) off topic - dna snipets (1997) Price recalc based on quantity (1997) PIXO (1997) [searchString] (1997) Forcing price recalculation in shopping cart (1998) Fun with dates (1997) [INCLUDE] Limitations (1998) [WebDNA] WebDNA version 6.2 to install on 64 bit CentOS 5 server? (2015) Sort Order on a page search (1997) New public beta available (1997) WebCat2b15MacPlugin - showing [math] (1997) expired beta (1997) carriage returns in data (1997) Displaying backgrounds (1999) webcat/webmerchant docs (1997) (1997)