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

[REBOL] Re: Extracting a date..

From: gjones05:mail:orion at: 12-May-2001 16:10

Hi, again, all, Ingo did create the most robust solution. When you encased it into a function, you appear to have forgotten to change 'fdata to 'text. From: "P-O Yliniemi"
> Hi, > > Thanks for the solutions to this problem. I finally decided to use and > extend Ingo's solution (but I already had a version that works based
on
> the Scott's example) because it didn't accept 'May 1a 20ab' as the
date,
> and because I already had need for a block with the abbreviated month > names. > > Thanks to Joel for the explanation why my initial attempts failed, and > to Graham for the first attempt to solve the problem (which should
have
> succeeded with a little more experimenting). > > Changes: made into a function which returns a numerical date format of > yy(yy)-mm-dd, or 'none' if no date in file. > > --- > extract-date: func [ > {Extract the first occurrance of a date [mmm-d(d)-yy(yy)] in a
string}
> text [string!] {The string to extract the date from} > /local space digit month day year date-rule m d y > ][ > space: [ thru " " ] > digit: charset [#"0" - #"9"] > month: [ "jan" | "feb" | "mar" | "apr" | "may" | "jun" | "jul" |
aug |