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

little parsing difficulty

 [1/4] from: arolls:idatam:au at: 29-Oct-2001 11:21


Can anyone see what is wrong with this? (watch wrap)
>> s:
{5^-15:15:37^-EXPLORER.EXE^-FASTIO_QUERY_OPEN^-E:\Utils\regmon\REGMON.EXE^-S UCCESS^-^-} == {5^-15:15:37^-EXPLORER.EXE^-FASTIO_QUERY_OPEN^-E:\Utils\regmon\REGMON.EXE^-S UCCESS^-^-}
>> parse/all s [to "e:\" p: to "^-" (probe p)]
E:\Utils\regmon\REGMON.EXE^-SUCCESS^-^- == false Why is "SUCCESS" included in the output? (I don't want "SUCCESS" ;) Anton.

 [2/4] from: cybarite::sympatico::ca at: 28-Oct-2001 20:13


Hi Anton, Just a guess but the marker p: that you added is the start of the string but you also want to add an end string marker.
>From the REBOL manual on parser circa 1999
is this example to parse for the title part by using two markers begin: and ending: then copying between the markers. parse page [thru <title> begin: to </title> ending:] copy/part begin ending I didn't try this but I think it will not bring you success. 10/28/01 7:21:41 PM, "Anton Rolls" <[arolls--idatam--com--au]> wrote:

 [3/4] from: arolls:idatam:au at: 29-Oct-2001 14:16


Ah heck. Thanks. What I wanted was this: parse/all s [to "e:\" p: to "^-" q: (probe copy/part p q)] Anton.

 [4/4] 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