Created
June 13, 2011 17:07
-
-
Save edw/1023199 to your computer and use it in GitHub Desktop.
Add support for writing regex patterns to JSON-STR
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
| (ns foo | |
| (:use [clojure.contrib json])) | |
| (extend java.util.regex.Pattern | |
| json/Write-JSON | |
| {:write-json (fn [re w] (.write w (json-str (.pattern re))))}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment