Skip to content

Instantly share code, notes, and snippets.

@dakrone
Created April 14, 2010 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dakrone/366261 to your computer and use it in GitHub Desktop.
Save dakrone/366261 to your computer and use it in GitHub Desktop.
(defn- strip-funny-chars
"Strip out some characters that might cause trouble parsing the tree."
[s]
(-> s
(.replaceAll "'" "-SQUOTE-")
(.replaceAll "\"" "-DQUOTE-")
(.replaceAll "~" "-TILDE-")
(.replaceAll "`" "-BACKTICK-")
(.replaceAll "," "-COMMA-")
(.replaceAll "\\\\" "-BSLASH-")
(.replaceAll "\\/" "-FSLASH-")
(.replaceAll "#" "-HASH-")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment