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

[REBOL] Re: Parse limitation ?

From: ingo:2b1 at: 8-Oct-2003 12:50

Hi Patrick, patrick la poste wrote:
> Hi List, > > I'd like to parse a string searching for two things at the same time. > it seems to me that this is impossible.
One trick is, to find something that is equal between the two strings, and work from there ... REBOL [] myText: {<A HREF="#section1"><IMG SRC="foobar.gif"><A HREF="#section2">} parse/all myText [ any [ to "=" here: (there: at here -4) :there [ [ "HREF=" | " SRC=" ] copy target to ">" (print target) | thru "=" ] ] ] ; parse In this example I used the "=" which is common to both strings, checked whether what I have _before_ this sign is one of the two strings I'm interested in, and then start to copy, or just go thru the "=" to start again ... I hope that helps, Ingo