[REBOL] Re: parse oddity
From: jamesh:volition-inc at: 26-Mar-2001 13:17
> >> 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,
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.