Found this tutorial: http://www.serpentine.com/blog/2007/02/27/a-haskell-regular-expression-tutorial/ Seems to work for what I need to do. Michael ========= [michael@localhost ~]$ ghci GHCi, version 6.10.4: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. Prelude> :mod +Text.Regex.Posix Prelude Text.Regex.Posix> "bar" =~ "(foo|bar)" :: Bool Loading package syb ... linking ... done. Loading package array-0.2.0.0 ... linking ... done. Loading package bytestring-0.9.1.4 ... linking ... done. Loading package regex-base-0.72.0.2 ... linking ... done. Loading package regex-posix-0.72.0.3 ... linking ... done. True Prelude Text.Regex.Posix> "-123" =~ "\-?[0-9]+" :: Bool <interactive>:1:13: lexical error in string/character literal at character '?' Prelude Text.Regex.Posix> "-123" =~ "[+-]?[0-9]+" :: Bool True Prelude Text.Regex.Posix> "+123" =~ "[+-]?[0-9]+" :: Bool True Prelude Text.Regex.Posix> "abc" =~ "[+-]?[0-9]+" :: Bool False Prelude Text.Regex.Posix> --- On Mon, 3/15/10, Stephen Tetley <stephen.tetley@gmail.com> wrote:
|