diff --git a/SGrep.hs b/SGrep.hs
new file mode 100644
--- /dev/null
+++ b/SGrep.hs
@@ -0,0 +1,17 @@
+-- Sequence Grep - search sequences for regular expressions
+
+module Main where
+
+import Bio.Sequence
+
+import Text.Regex
+import System.IO
+import System.Environment
+
+main :: IO ()
+main = do
+  [pat,file] <- getArgs
+  let match s = case matchRegex (mkRegex pat) (toStr $ seqheader s) of 
+        Just _ -> True; _ -> False
+  hWriteFasta stdout =<< filter match `fmap` readFasta file
+  
diff --git a/Setup.hs b/Setup.hs
new file mode 100644
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,5 @@
+#!/usr/bin/env runhaskell
+ 
+import Distribution.Simple
+main = defaultMain
+
diff --git a/sgrep.cabal b/sgrep.cabal
new file mode 100644
--- /dev/null
+++ b/sgrep.cabal
@@ -0,0 +1,17 @@
+Name:          sgrep
+Version:       0.0
+License:       GPL	
+Category:      Bioinformatics
+Author:        Ketil Malde
+Maintainer:    Ketil Malde <ketil@malde.org>
+Homepage:      http://blog.malde.org/
+
+Synopsis:      Sgrep - grep Fasta files for sequences matching a regular expression
+Description:   This is a simple utility to extract sequences from Fasta files. It
+	       expects its first parameter to be a regular expression, and its second
+	       to be a Fasta-formatted file.  It will then output all sequences matching
+	       the regexp to standard output.
+Build-Type:    Simple
+Executable:    sgrep
+Build-Depends: base>=3 && <5, bio, regex-compat
+Main-Is:       SGrep.hs
