Skip to content

Instantly share code, notes, and snippets.

@tolysz
Created January 11, 2016 11:15
Show Gist options
  • Save tolysz/5607133409b37d89c9c5 to your computer and use it in GitHub Desktop.
Save tolysz/5607133409b37d89c9c5 to your computer and use it in GitHub Desktop.
{-# LANGUAGE QuasiQuotes #-}
module Main where
import Text.Regex.PCRE.Heavy (gsub, re, Regex)
ignore_comments :: [Regex] -> [String]
ignore_comments rs =
map (\r -> gsub r ("":: String) ("/*test commentary*/ abc test")) rs
main :: IO ()
main = do
mapM_ putStrLn $ ignore_comments [ [re|/|], [re|\/|], [re|\\/|], [re|\\\/|], [re|\\\\/|], [re|\\\\\/|], [re|\\\\\\/|], [re|\\\\\\\/|] ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment