Created
December 26, 2013 06:13
-
-
Save mmhelloworld/8130374 to your computer and use it in GitHub Desktop.
Frege Regex
This file contains 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
frege> pure native groupCount :: Matcher -> Int | |
frege> match s regex = groups <$> (s =~ regex) where groups m = [m.group i | i <- [1..groupCount m]] | |
frege> Just (Just year: Just month: Just day: _) = "2011-07-15" `match` #(\d\d\d\d)-(\d\d)-(\d\d)# | |
frege> println [year, month, day] | |
["2011", "07", "15"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment