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%26defabc%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:
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%26defabc%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:
Webmerchant email misinterpreted tags (1998)
Templates on Unix & CGI on Mac? (1997)
Help! WebCat2 bug (1997)
[username][password] not showing up! HELP! (1999)
Running _every_ page through WebCat-error.html (1997)
RE: Nested [SEARCH] and [REPLACE] problem. (1997)
cron script for housekeeping and running WebCatalog? (1999)
[format 40s]text[/format] doesn't work (1997)
Resume Catalog ? (1997)
RSS Feed (2004)
problems with 2 tags (1997)
SQL Madness (2005)
New [If] command question + New Feature Request (2000)
WebCat2b13MacPlugin - [math][date][/math] problem (1997)
WebMerchant crashing and other WebMerchant problem (2000)
[Fwd: Rotating Banners ... (was LinkExchange)] (1997)
syntax question, not in online refernce (1997)
RE: Automatic Forwarding using WebCat (1997)
Date in IF ELSE Comparison (2004)
WCS Newbie question (1997)