Re: Re(2): & in grep

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 51108
interpreted = N
texte = I can't quite grasp what you are trying to do or what you see as wrong, but in general using %26 works for & replacement in a [grep]... As a simple example:[text]x=abc&def[/text] [url][x][/url]
[text]y=[grep search=%26&replace=%26amp;][x][/grep][/text] [url][y][/url]
yields:abc%26def abc%26amp%3Bdef- brianOn Monday, June 16, 2003, at 08:10 AM, laurent pladys wrote:>>> Is there a way to encode & in the %XX form as we do for [ and ] ? >> >> The encoded value of & is %26 > Thanks Ken, I tried that but it still doesn't work. > > > %26 in a grep pattern breaks the result. > atraduire=fr-test1 becomes atraduire=fr-r1 > > Is there w way to put the & symbol in a grep, is it possible to > escape > it ? \& doesn't work, %28 doens't work ... > > I changed the first opening square bracket on purpose so it shows up. > > Here are the result with %26 and a # to comppare what happens. > > When using : > > [writefile secure=F&file=../[langue]/[refpage].c-lvl] > [grep search=traduire.([0-9A-Za-z]*)&replace=(include file=../div/ > traduction.inc%26atraduire=[interpret][lng][/interpret]-\1%5D] > > [include file=../pages/[word].c-lvl&valeuridmultiple=[newnumero]] > [/grep] > [/writefile] > > I have this : > > include file=../div/traduction.inc&atraduire=fr-r1] > (include file=../div/traduction.inc&atraduire=fr-r1] (include file=../ > div/traduction.inc&atraduire=fr-r1] > > And when I write this : > [writefile secure=F&file=../[langue]/[refpage].c-lvl] > [grep search=traduire.([0-9A-Za-z]*)&replace=(include file=../div/ > traduction.inc#atraduire=[interpret][lng][/interpret]-\1%5D] > > [include file=../pages/[word].c-lvl&valeuridmultiple=[newnumero]] > [/grep] > [/writefile] > > > I have this : > (include file=../div/traduction.inc#atraduire=fr-test1] > (include file=../div/traduinclude file=../div/ > traduction.inc#atraduire=fr-test1ction.inc#atraduire=fr-test2] (include > file=../div/traduction.inc#atraduire=fr-test3] > > In the file I am including I have the following text : > > traduire=test1 >
> traduire=test2 traduire=test3 > > That I expect the grep search to replace with : > > include file=../div/traduction.inc&atraduire=fr-test1 >
> include file=../div/traduction.inc&atraduire=fr-test2 include file=../ > div/traduction.inc&atraduire=fr-test3 > > > ------------------------------------------------------------- > 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(2): lookup limitation ? (laurent pladys 2003)
  2. Re: Re(2): & in grep (Rob Marquardt 2003)
  3. Re: Re(2): & in grep (Brian Fries 2003)
  4. Re(2): & in grep (laurent pladys 2003)
  5. Re: Re(2): grep matching (Brian Fries 2003)
  6. Re: Re(2): typhoon ? (dale 2003)
  7. Re: Re(2): typhoon ? (Brian Boegershausen 2003)
  8. Re: Re(2): typhoon ? (Mark Derrick 2003)
  9. Re: Re(2): MASTER_STORE revision (Dan Strong 2002)
  10. Re: Re(2): MASTER_STORE revision (Alain Russell 2002)
  11. Re: Re(2): Foreign Chars ( יאצה and so on) (richard 1998)
  12. Fwd: Re(2): Password and Allow commands (l.bache@interacti-system.fr (Laurent Bache) 1998)
  13. Re(2): Re(2): SSL, WebSTAR, WebCatalog (l.bache@interacti-system.fr (Laurent Bache) 1998)
  14. Re: Re(2): SSL, WebSTAR, WebCatalog (Pat McCormick 1998)
I can't quite grasp what you are trying to do or what you see as wrong, but in general using %26 works for & replacement in a [grep]... As a simple example:[text]x=abc&def[/text] [url][x][/url]
[text]y=[grep search=%26&replace=%26amp;][x][/grep][/text] [url][y][/url]
yields:abc%26def abc%26amp%3Bdef- brianOn Monday, June 16, 2003, at 08:10 AM, laurent pladys wrote:>>> Is there a way to encode & in the %XX form as we do for [ and ] ? >> >> The encoded value of & is %26 > Thanks Ken, I tried that but it still doesn't work. > > > %26 in a grep pattern breaks the result. > atraduire=fr-test1 becomes atraduire=fr-r1 > > Is there w way to put the & symbol in a grep, is it possible to > escape > it ? \& doesn't work, %28 doens't work ... > > I changed the first opening square bracket on purpose so it shows up. > > Here are the result with %26 and a # to comppare what happens. > > When using : > > [writefile secure=F&file=../[langue]/[refpage].c-lvl] > [grep search=traduire.([0-9A-Za-z]*)&replace=(include file=../div/ > traduction.inc%26atraduire=[interpret][lng][/interpret]-\1%5D] > > [include file=../pages/[word].c-lvl&valeuridmultiple=[newnumero]] > [/grep] > [/writefile] > > I have this : > > include file=../div/traduction.inc&atraduire=fr-r1] > (include file=../div/traduction.inc&atraduire=fr-r1] (include file=../ > div/traduction.inc&atraduire=fr-r1] > > And when I write this : > [writefile secure=F&file=../[langue]/[refpage].c-lvl] > [grep search=traduire.([0-9A-Za-z]*)&replace=(include file=../div/ > traduction.inc#atraduire=[interpret][lng][/interpret]-\1%5D] > > [include file=../pages/[word].c-lvl&valeuridmultiple=[newnumero]] > [/grep] > [/writefile] > > > I have this : > (include file=../div/traduction.inc#atraduire=fr-test1] > (include file=../div/traduinclude file=../div/ > traduction.inc#atraduire=fr-test1ction.inc#atraduire=fr-test2] (include > file=../div/traduction.inc#atraduire=fr-test3] > > In the file I am including I have the following text : > > traduire=test1 >
> traduire=test2 traduire=test3 > > That I expect the grep search to replace with : > > include file=../div/traduction.inc&atraduire=fr-test1 >
> include file=../div/traduction.inc&atraduire=fr-test2 include file=../ > div/traduction.inc&atraduire=fr-test3 > > > ------------------------------------------------------------- > 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/ 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:

[WriteFile] problems (1997) triggers (2003) Error messages (2004) [WriteFile] problems (1997) WebCat2 several catalogs? (1997) Ok here is a question? (1997) WebCatalog for Postcards ? (1997) email program problem (1998) WebCat2.0 acgi vs plugin (1997) help testing quicktime delivery (1997) suffix mapping, use of cache, etc. (1997) [ShowNext] (1997) Re:2nd WebCatalog2 Feature Request (1996) Accepting credit cards (1997) Credit card types (1997) Not reading code (1997) Quitting WebMerchant ? (1997) security (1997) Mass Mail (2000) delete command not working (2000)