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

[REBOL] Re: Parsing until the end

From: otherchaz:mindspring at: 6-Jan-2003 6:05

Because XY is special delimiter, let's make special letters! This is REBOL, so data is part of the code!
>> letter: charset [#"a" - #"z" #"A" - #"W" #"Z"]
== make bitset! #{ 0000000000000000FEFFFF04FEFFFF070000000000000000000000000 0000000 }
>> >> string1: "XYhelloXYpeopleXYXYhowXYareXYyouXY"
== "XYhelloXYpeopleXYXYhowXYareXYyouXY"
>> >> string2: "XYhelloXYpeopleXYXYhowXYareXYyou"
== "XYhelloXYpeopleXYXYhowXYareXYyou"
>> >> my-magic-split: func [input-string] [
parse input-string [ some ["XY" some letter] "XYXY" copy footext some letter copy bartext some ["XY" some letter] "XY" end (print [ append footext bartext ]) | none ]]
>> >> my-magic-split string1
howXYareXYyou == true
>> >> my-magic-split string2
== false chaz