Created
September 17, 2012 14:24
-
-
Save dmalikov/3737645 to your computer and use it in GitHub Desktop.
GREP PATTERN -A ∞
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
{-# LANGUAGE UnicodeSyntax #-} | |
import Control.Applicative ((<$>)) | |
import System.Environment (getArgs) | |
import Text.Regex.Posix ((=~)) | |
main ∷ IO () | |
main = do | |
pattern ← head <$> getArgs | |
mapM_ putStrLn =<< dropWhile (\α → not $ α =~ pattern) . lines <$> getContents |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment