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


-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

Reply via email to