diff options
author | simonmar <unknown> | 1999-11-26 16:29:44 +0000 |
---|---|---|
committer | simonmar <unknown> | 1999-11-26 16:29:44 +0000 |
commit | 7700dda03d273676b274bc148491a4e02a7c5ae0 (patch) | |
tree | 09de9743e3b9f9c7a4108660230969ce893947df /ghc/lib/misc/RegexString.lhs | |
parent | ef33ed94129ee17b577add392e04619ec1f53800 (diff) | |
download | haskell-7700dda03d273676b274bc148491a4e02a7c5ae0.tar.gz |
[project @ 1999-11-26 16:29:09 by simonmar]
GHC bits for new library organisation.
Diffstat (limited to 'ghc/lib/misc/RegexString.lhs')
-rw-r--r-- | ghc/lib/misc/RegexString.lhs | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/ghc/lib/misc/RegexString.lhs b/ghc/lib/misc/RegexString.lhs deleted file mode 100644 index 8bc98a5a02..0000000000 --- a/ghc/lib/misc/RegexString.lhs +++ /dev/null @@ -1,34 +0,0 @@ ------------------------------------------------------------------------------ -RegexString.lhs - -A simple high-level interface to Regex - -(c) Simon Marlow 1997 ------------------------------------------------------------------------------ - -> module RegexString (Regex(..), mkRegex, matchRegex) where - -> import Regex -> import PackedString -> import Array -> import GlaExts - -> type Regex = PatBuffer -> -> mkRegex :: String -> Regex -> mkRegex s = unsafePerformPrimIO ( -> re_compile_pattern (packString s) False False) -> -> matchRegex :: Regex -> String -> Maybe [String] -> matchRegex p s = unsafePerformPrimIO ( -> re_match p str 0 True >>= \m -> -> case m of -> Nothing -> return Nothing -> Just m -> return (Just (matches m str)) -> ) -> where -> str = packString s -> -> matches (REmatch arr _ _ _ _) s = -> [ unpackPS (substrPS s beg (end-1)) | -> index <- [1..], let (beg,end) = arr ! index ] |