Skip to content

Instantly share code, notes, and snippets.

@dyoo
Created March 10, 2013 22:37
Show Gist options
  • Save dyoo/5130815 to your computer and use it in GitHub Desktop.
Save dyoo/5130815 to your computer and use it in GitHub Desktop.
date string parsing example for rich1
#lang racket
(define (parse-date-string str)
(match str
[(pregexp #px"^(\\d{4})-(\\d{2})-(\\d{2})$" (list _ year month day))
(list (string->number year)
(string->number month)
(string->number day))]))
(parse-date-string "2013-03-10")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment