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

[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, 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