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

[REBOL] Re: Extracting a date..

From: ingo:2b1 at: 12-May-2001 18:39

Hi PeO, yes having 'to and 'thru work on subrules would make some things so much easier ... Well, here is my suggestion, with the added benefit, that it works even if one of the month abbrevs is part of the text before the date. [REBOL[] fdata: { ---------------------------------------------------------------------------- Some other text here June and May walked the talk May 11 2001 Some other text here ---------------------------------------------------------------------------- } space: [ thru " " ] digit: charset [#"0" - #"9"] month: [ "jan" | "feb" | "mar" | "apr" | "may" | "jun" | "jul" | "aug" | "sep" | "oct" | "nov" | "dec" ] day: [ 1 2 digit ] year: [ 2 4 digit ] the_rule: [ copy m month space copy d day space copy y year ] parse/all fdata [ any [ the_rule to end | thru " " ]] date: to-date rejoin [y "-" m "-" d] ] kind regards, Ingo