Created
March 14, 2013 01:08
-
-
Save jbclements/5157987 to your computer and use it in GitHub Desktop.
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 lines | |
(list "hootehutt 23 hoethoet 4" | |
"abc 9 thuoteh 9")) | |
(define (maybe-numify s) | |
(match (regexp-match #px"[0-9]+" s) | |
[#f s] | |
[else (string->number s)])) | |
(for/list ([l lines]) | |
(map maybe-numify (string-split l))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment