Created
March 10, 2013 22:37
-
-
Save dyoo/5130815 to your computer and use it in GitHub Desktop.
date string parsing example for rich1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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