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

[REBOL] Re: Parsing optional tags

From: lmecir:mbox:vol:cz at: 5-Nov-2001 0:35

Hi Geza, it doesn't have to be so complicated, my version probably checks more things than you needed (check if the tags are balanced etc.). There obviously is a simpler way how to do this. Hello Ladislav,
> i-tag: [copy collect to </i> </i>] > not-i-tag: [copy collect to </b>] > b-tag: [[<i> (following: i-tag) | (following: not-i-tag)] following
(append
> collects collect) </b>] > htmlrule: [[thru <b> (follow: [b-tag htmlrule]) | to end (follow: [none])] > follow] > parse html htmlrule
Thank you for the working version but I just can't believe it has to be so complicated - building a (in a way) complete syntax to strip off two lousy HTML-tags ... :-( If this is the more-or-less only "obvious" way to do it in the REBOL parse dialect, I'll better stick to the old-fashioned way and build a regex and feed it through sed/awk/vim or something like that. -- Best regards, Geza mailto:[geza67--freestart--hu]