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

[REBOL] parse, I think, (again) Re:

From: al::bri::xtra::co::nz at: 30-Sep-2000 22:25

tom wrote:
> If given a block, ["text, text -b text --b , text"], > how do I replace -b and --b with <b> and </b>, respectively?
This is the most direct way:
>> block: ["text, text -b text --b , text"]
== ["text, text -b text --b , text"]
>> string: copy first block
== "text, text -b text --b , text"
>> replace/all string "--b" "</b>"
== "text, text -b text </b> , text"
>> replace/all string "-b" "<b>"
== "text, text <b> text </b> , text" Easy is:
>> do %html.r >> block: [body "text, text " bold "text" ", text"]
== [body "text, text " bold "text" ", text"]
>> HTML block
== {<html> <head> </head> <body> text, text <b>text</b>, text</body> </html> } YMMV. Andrew Martin ICQ: 26227169 http://members.nbci.com/AndrewMartin/ http://members.xoom.com/AndrewMartin/