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:

Encrypt question. (2000) Nutscrape Doesn't Render Right (2002) [PHP3] php vs WebCatalog (2000) sort problems....bug or brain fart? (1997) Show if time tags (1997) Re:Can this be done? (1997) taxRate is fine but taxTotal isn't (1997) WebCat2b15MacPlugin - showing [math] (1997) wee problem (2001) How did *you* learn Web Catalog? (2000) Hiding the URL(was Cart ID Duplication) (2001) StoreBuilder Q's (2003) Secure server question (1997) WebDelivery downloads alias, not original ? (1997) required fields (1998) Help! WebCat2 bug (1997) WebCat2b12 CGI Mac - [shownext] problem (1997) YACBQ.....(Yet another checkbox question) (2000) [sql] problems in WebCat 4.0 (2000) [WriteFile] problems (1997)