[REBOL] Re: little parsing difficulty
From: brett:codeconscious at: 29-Oct-2001 15:01
Hi Anton,
Cybarite has already given a solution to this I'll add that the following
should explain it:
>> index? p
== 43
>> same? s head p
== true
And so you probably want something like:
>> parse/all s [to "e:\" p: to "^-" p2: (probe p)]
"E:\Utils\regmon\REGMON.EXE^-SUCCESS^-^-"
== false
>> p2
== "^-SUCCESS^-^-"
>> copy/part p p2
== "E:\Utils\regmon\REGMON.EXE"
Or more simply:
>> parse/all s [to "e:\" copy p to "^-" (probe p)]
"E:\Utils\regmon\REGMON.EXE"
== false
And to get the correct result from parse:
>> parse/all s [to "e:\" copy p to "^-" (probe p) to end]
E:\Utils\regmon\REGMON.EXE
== true
Brett