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

[REBOL] Re: Help with search/replace code

From: chaz:innocent at: 27-Nov-2000 22:25

How about something like this? rebol [] p1: "----- [quote]first[quote]second[/quote]third[/quote] ---- ++and again++ ---- [quote]first/2[quote]second/2[/quote]third/2[/quote] ---------" p2: "Normal size text [size=4] large text[/size] back to normal text" post: join p1 [p2] parse post [ any [to "[quote]" quotestart: thru "[quote]" copy first to "[" nextbrace: (change/part quotestart compose [ "<blockquote><hr><font size=^"1^" face=^"verdana, helvetica^">" (first) "</font>"] nextbrace)]] parse post [ any [to "[/quote]" endquotestart: thru "[/quote]" endquoteend: (change/part endquotestart "</blockquote>" endquoteend)]] parse post [ any [to "[size=" sizestart: thru "[size=" copy sizevalue to ] thru "]" sizeend: (change/part sizestart compose [ "<font size = " (sizevalue) ">" ] sizeend)]] parse post [ any [to "[/size]" endsizestart: thru "[/size]" endsizeend: (change/part endsizestart "</font>" endsizeend)]] print post At 09:11 AM 11/27/00 -0000, you wrote: