Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Quote character replacement

From: g::santilli::tiscalinet::it at: 26-Feb-2001 21:17

Hello Rod! On 26-Feb-01, you wrote: RG> Hi Elan, RG>> Do you need to preserve the newlines in the string? RG> No, they were introduced into the file due to some output RG> wrapping. Then I can imagine what Elan's going to propose: replace all newlines with a space. Anyway, just for fun, let's try converting those quotes.
>> rule: [any [to {"} mark: skip (change mark "{") to {"} mark: skip (change mark "}")]]
== [any [to {"} mark: skip (change mark "{") to {"} mark: skip (change mark "}")]]
>> test: {
{ Description "This is a sample field { description" { } == { Description "This is a sample field description" }
>> parse/all test rule
== false
>> test
== { Description {This is a sample field description} }
>> test: {
{ it "should" be able to "convert your { quotes" as long as they are balanced. { "Hope this helps." { } == { it "should" be able to "convert your quotes" as long as they are balanced. Hope this helps. }
>> parse/all test rule
== false
>> test
== { it {should} be able to {convert your quotes} as long as they are balanced. {Hope this helps.} } Regards, Gabriele. -- Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/