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

[REBOL] Re: more? parse

From: g:santilli:tiscalinet:it at: 29-Jul-2003 17:45

Hi Rebolinth, On Tuesday, July 29, 2003, 4:37:36 PM, you wrote: R> With my experiences on the 'find function i moved towards 'parse for better R> string handling.(pfffiew what a relief ;-) As it seemed in the first place... R> According to the examples in [ http://www.rebol.com/docs/core23/rebolcore- R> 15.html#sect10.5. ] it should be possible to find characters inside a string. I think I don't understand what you want to do...
>>> probe parse "thisisaverylongstringwhichcouldbeusedbyparse" "very"
R> == ["thisisa" "" "" "" "longst" "ingwhichcouldb" "us" "db" "pa" "s"]
>>> parse/all "thisisaverylongstringwhichcouldbeusedbyparse" {"very"}
R> == ["thisisa" "" "" "" "longst" "ingwhichcouldb" "us" "db" "pa" "s"] Used this way, PARSE splits your string based on the delimiters you give as the second argument.
>>> probe parse "thisisaverylongstringwhichcouldbeusedbyparse" [ thru "isa"
R> to "long" ] R> == false Here, PARSE applies the rule given as its second argument to the string. The rule does not reach the end of the string, so PARSE returns false. Maybe you just wanted this?
>> find "thisisaverylongstringwhichcouldbeusedbyparse" "very"
== "verylongstringwhichcouldbeusedbyparse" Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amiga Group Italia sez. L'Aquila --- SOON: http://www.rebol.it/