[REBOL] Re: using 'find to search
From: alan_otterstad:mikronvinyl at: 11-Apr-2001 15:00
Ryan,
Just putting in 2 cents worth to try and help...i'm not very good at Rebol
yet.
Does find work like parse...if so then I noticed in another message the
solution was to include a "to end" at the end of the command to make sure
that the entire string/block you are searching thru gets processed.
example I am referring to is:
> >> parse "html" ["htm" | "html"]
> == false
> (the above is what bothers me)
Two things to note:
1. When you match against a group of strings, the first possible match is
the one you get. In your case, the "htm" is matching before the "html",
which is correct.
2. parse only returns true if the entire string is parsed. In your
example,
html
is matched with "htm", so you have the "l" remaining unparsed. This
gives a result of false. If you change your example to:
parse "html" [["htm" | "html"] to end]
Then you'll get true instead.
James
this is from a previous message about parse. I was hoping that the 'to
end' might also work in the same way in find.
if not then oh well. I was just trying to help.
Alan