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

[REBOL] Re: Parse doing weird things...

From: jelinem1:nationwide at: 19-Mar-2001 10:34

If the problem really is that you are looking for a TRUE return from 'parse, then the explaination is simple. 'parse will return TRUE only if it can successfully match the entire string according to the given rules. Placing "to end" as your final rule should give you the result you desire. Even though 'parse is returning FALSE, your word should be set to the substring between "something" and "somethingelse". What I do in your case is to set 'datamine to NONE previous to the 'parse, then check its value afterward to determine whether it was set to a string!. - Michael Jelinek Mat Bettinson <[mat--eurogamer--net]> on 03/19/2001 09:20:49 AM From: Mat Bettinson <[mat--eurogamer--net]> on 03/19/2001 09:20 AM Please respond to [rebol-list--rebol--com] Sent by: [rebol-bounce--rebol--com] To: Mat Bettinson <[rebol-list--rebol--com]> cc: Subject: [REBOL] Parse doing weird things... Heya, While I'm at it; I've noticed this issue repeatedly in my data mining scripts. The parse command sometimes just will not work with the following format; webpage: read datamine: make string! "" parse webpage [thru "something" copy datamine to "somethingelse"] In the vast bulk of cases it works but right now I'm sitting in my Rebol console with a bag load of HTML fragment in a variable and parse turns up false every time. Now the rules DO match the content in the html! Specifically; parse tmp/content [thru "Etymology:" copy DictEnty to "<br>"] Here's everything I've tried that I can remember. tmp/content comes from HTTP-TOOLS and I've tried loading it into another variable, no luck. Etymology: *does* exist. If I put 'to end' instead of the <br> tag then it parses true. Find also turns up Etymology as well. It doesn't appear to matter WHAT I put in the quotes at the end. IE I can hunt for a couple of plain letters that are in the string directly following Etymology. It doesn't appear to make any difference that this is a tag. Finally, all of this worked before and now it doesn't. In the past to cure this random parse blowout, I've had to cut down on the data I'm trying to parse. All of the above leads me to think there is some sort of restriction to how much data can be parsed before some sort of feature/limitation/bug is run into. Anyone seen this before? Comments? -- Mat Bettinson - EuroGamer's Gaming Evangelist with a Goatee |