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

[REBOL] Re: parse, again...

From: nitsch-lists:netcologne at: 2-Nov-2001 7:19

RE: [REBOL] Re: parse, again... [lmecir--mbox--vol--cz] wrote:
> Hi Halvard, > > > But try > > html-code: [ copy tag ["<" thru ">"] | copy txt [to "<" | to end] (print > txt)] > > parse/all read http://www.rebol.com/ [to "<" some html-code] > > > > ...and see what you get... (Why?) > > > > ~H > > > > Praetera censeo Carthaginem esse delendam > > your bug simplified: > > rule1: [to end] > parse/all "a" [some rule1] > > you cannot write a rule like this, because parse will run forever (hint: > rule1 is always fulfilled). This is why the correct form of your rule should > be: > > html-code: [ copy tag ["<" thru ">"] | copy txt [to "<" | some skip] > (print txt)] > parse/all read http://www.rebol.com/ [to "<" some html-code]
or [skip to end], which tells you want at least one char in the string. html-code: [ copy tag ["<" thru ">"] | copy txt [to "<" | skip to end] (print txt)] parse/all read http://www.rebol.com/ [to "<" some html-code] -Volker