[REBOL] Re: parse, again...
From: ryanc:iesco-dms at: 1-Nov-2001 9:48
Haha, good point Volker, someone cant go thru the end!
--Ryan
[nitsch-lists--netcologne--de] wrote:
> RE: [REBOL] parse, again...
>
> [hallvard--ystad--helpinhand--com] wrote:
> >
> > I seem to get something wrong. Look here:
> > >> html-code: [ copy tag ["<" thru ">"] | copy txt to "<" ]
> > == [copy tag ["<" thru ">"] | copy txt to "<"]
> > >> parse/all read http://www.rebol.com/ [to "<" some html-code]
> > connecting to: www.rebol.com
> > == false
> >
> > This returns false because the website ends with some whitespace after the
> > last tag. I redefine 'html-code and try again:
> > >> html-code: [ copy tag ["<" thru ">"] | copy txt [to "<" | thru end]]
> > == [copy tag ["<" thru ">"] | copy txt [to "<" | thru end]]
> > >> parse/all read http://www.rebol.com/ [to "<" some html-code]
> > connecting to: www.rebol.com
> > == false
> >
>
> well,
> >> parse "hello" [thru end]
> == false
> >> parse "hello" [to end]
> == true
>
> ;-) Volker
>
> > Hm. Why does this return false? Another try:
> > >> html-code: [ copy tag ["<" thru ">"] | copy txt to "<" | copy txt thru
> > end ]
> > == [copy tag ["<" thru ">"] | copy txt to "<" | copy txt thru end]
> > >> parse/all read http://www.rebol.com/ [to "<" some html-code]
> > connecting to: www.rebol.com
> > == false
> >
> > Still wrong return value from 'parse. But then, finally:
> > >> html-code: [ copy tag ["<" thru ">"] | copy txt to "<" | skip]
> > == [copy tag ["<" thru ">"] | copy txt to "<" | skip]
> > >> parse/all read http://www.rebol.com/ [to "<" some html-code]
> > connecting to: www.rebol.com
> > == true
> >
> > So I managed, finally. But what if I want to use whatever is written after
> > the last tag? And especially: what's wrong with my second approach?
> >
> > I know this probably is basic, and that it's probably been answered a
> > hundred times already on this mailing list, but I just can't seem to find
> > the solution (and I _have_ searched, yes).
> >
> > ~H
> >
> > Praetera censeo Carthaginem esse delendam
> >
> > --
> > To unsubscribe from this list, please send an email to
> > [rebol-request--rebol--com] with "unsubscribe" in the
> > subject, without the quotes.
> >
> --
> To unsubscribe from this list, please send an email to
> [rebol-request--rebol--com] with "unsubscribe" in the
> subject, without the quotes.
--
Ryan Cole
Programmer Analyst
www.iesco-dms.com
707-468-5400