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

[REBOL] Extracting a date..

From: peoyli::algonet::se at: 12-May-2001 13:53

Hi, I have tried to extract a date in a format (currently) not supported by REBOL, without any great success.. The part of the file I want to read from looks like: fdata: { ---------------------------------------------------------------------------- Some other text here May 11 2001 Some other text here ---------------------------------------------------------------------------- } which should be very easy to parse.. (from some other alike answer I found in the list): Setting up a rule for the date format: digit: charset [#"0" - #"9"] mon-abbrev: ["jan" | "feb" | "mar" | "apr" | "may" | "jun" | "jul" | "aug" | "sep" | "oct" | "nov" | "dec"] date-rule: [mon-abbrev some #" " 1 2 digit some #" " 4 digit] then.. the problem begins..
>> date: copy "" parse fdata [to date-rule copy date to "^/" to end] print date
** Script Error: Invalid argument: mon-abbrev some 1 2 digit some 4 digit ** Near: parse fdata [to date-rule copy date to "^/" to end]
>> date: copy "" parse fdata [to "may" copy date to "^/" to end] print date
May 11 2001
>> date: copy "" parse fdata [[to "may" | "jun"] copy date to "^/" to end] print date
May 11 2001
>> date: copy "" parse fdata [[to "apr" | "may" | "jun"] copy date to "^/" to end] print date
(nothing) ... What should I change to make this work ? The first try which returned the script error seems to be the most logical one... /PeO