regex-with-pcre 0.14.0.0 → 1.0.0.0
raw patch · 15 files changed
+608/−364 lines, 15 filesdep ~regexPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: regex
API changes (from Hackage documentation)
- Text.RE.PCRE: class Replace s => IsRegex re s
- Text.RE.PCRE: makeEscaped :: (IsRegex re s, Functor m, Monad m) => (s -> s) -> s -> m re
- Text.RE.PCRE: makeEscapedWith :: (IsRegex re s, Functor m, Monad m) => SimpleREOptions -> (s -> s) -> s -> m re
- Text.RE.PCRE: makeRegex :: (IsRegex re s, Functor m, Monad m) => s -> m re
- Text.RE.PCRE: makeRegexWith :: (IsRegex re s, Functor m, Monad m) => SimpleREOptions -> s -> m re
- Text.RE.PCRE: makeSearchReplace :: (IsRegex re s, Functor m, Monad m, IsRegex re s) => s -> s -> m (SearchReplace re s)
- Text.RE.PCRE: makeSearchReplaceWith :: (IsRegex re s, Functor m, Monad m, IsRegex re s) => SimpleREOptions -> s -> s -> m (SearchReplace re s)
- Text.RE.PCRE: matchMany :: IsRegex re s => re -> s -> Matches s
- Text.RE.PCRE: matchOnce :: IsRegex re s => re -> s -> Match s
- Text.RE.PCRE: regexSource :: IsRegex re s => re -> s
- Text.RE.PCRE.ByteString: class Replace s => IsRegex re s
- Text.RE.PCRE.ByteString: makeEscaped :: (IsRegex re s, Functor m, Monad m) => (s -> s) -> s -> m re
- Text.RE.PCRE.ByteString: makeEscapedWith :: (IsRegex re s, Functor m, Monad m) => SimpleREOptions -> (s -> s) -> s -> m re
- Text.RE.PCRE.ByteString: makeRegex :: (IsRegex re s, Functor m, Monad m) => s -> m re
- Text.RE.PCRE.ByteString: makeRegexWith :: (IsRegex re s, Functor m, Monad m) => SimpleREOptions -> s -> m re
- Text.RE.PCRE.ByteString: makeSearchReplace :: (IsRegex re s, Functor m, Monad m, IsRegex re s) => s -> s -> m (SearchReplace re s)
- Text.RE.PCRE.ByteString: makeSearchReplaceWith :: (IsRegex re s, Functor m, Monad m, IsRegex re s) => SimpleREOptions -> s -> s -> m (SearchReplace re s)
- Text.RE.PCRE.ByteString: matchMany :: IsRegex re s => re -> s -> Matches s
- Text.RE.PCRE.ByteString: matchOnce :: IsRegex re s => re -> s -> Match s
- Text.RE.PCRE.ByteString: regexSource :: IsRegex re s => re -> s
- Text.RE.PCRE.ByteString.Lazy: class Replace s => IsRegex re s
- Text.RE.PCRE.ByteString.Lazy: makeEscaped :: (IsRegex re s, Functor m, Monad m) => (s -> s) -> s -> m re
- Text.RE.PCRE.ByteString.Lazy: makeEscapedWith :: (IsRegex re s, Functor m, Monad m) => SimpleREOptions -> (s -> s) -> s -> m re
- Text.RE.PCRE.ByteString.Lazy: makeRegex :: (IsRegex re s, Functor m, Monad m) => s -> m re
- Text.RE.PCRE.ByteString.Lazy: makeRegexWith :: (IsRegex re s, Functor m, Monad m) => SimpleREOptions -> s -> m re
- Text.RE.PCRE.ByteString.Lazy: makeSearchReplace :: (IsRegex re s, Functor m, Monad m, IsRegex re s) => s -> s -> m (SearchReplace re s)
- Text.RE.PCRE.ByteString.Lazy: makeSearchReplaceWith :: (IsRegex re s, Functor m, Monad m, IsRegex re s) => SimpleREOptions -> s -> s -> m (SearchReplace re s)
- Text.RE.PCRE.ByteString.Lazy: matchMany :: IsRegex re s => re -> s -> Matches s
- Text.RE.PCRE.ByteString.Lazy: matchOnce :: IsRegex re s => re -> s -> Match s
- Text.RE.PCRE.ByteString.Lazy: regexSource :: IsRegex re s => re -> s
- Text.RE.PCRE.Sequence: class Replace s => IsRegex re s
- Text.RE.PCRE.Sequence: makeEscaped :: (IsRegex re s, Functor m, Monad m) => (s -> s) -> s -> m re
- Text.RE.PCRE.Sequence: makeEscapedWith :: (IsRegex re s, Functor m, Monad m) => SimpleREOptions -> (s -> s) -> s -> m re
- Text.RE.PCRE.Sequence: makeRegex :: (IsRegex re s, Functor m, Monad m) => s -> m re
- Text.RE.PCRE.Sequence: makeRegexWith :: (IsRegex re s, Functor m, Monad m) => SimpleREOptions -> s -> m re
- Text.RE.PCRE.Sequence: makeSearchReplace :: (IsRegex re s, Functor m, Monad m, IsRegex re s) => s -> s -> m (SearchReplace re s)
- Text.RE.PCRE.Sequence: makeSearchReplaceWith :: (IsRegex re s, Functor m, Monad m, IsRegex re s) => SimpleREOptions -> s -> s -> m (SearchReplace re s)
- Text.RE.PCRE.Sequence: matchMany :: IsRegex re s => re -> s -> Matches s
- Text.RE.PCRE.Sequence: matchOnce :: IsRegex re s => re -> s -> Match s
- Text.RE.PCRE.Sequence: regexSource :: IsRegex re s => re -> s
- Text.RE.PCRE.String: class Replace s => IsRegex re s
- Text.RE.PCRE.String: makeEscaped :: (IsRegex re s, Functor m, Monad m) => (s -> s) -> s -> m re
- Text.RE.PCRE.String: makeEscapedWith :: (IsRegex re s, Functor m, Monad m) => SimpleREOptions -> (s -> s) -> s -> m re
- Text.RE.PCRE.String: makeRegex :: (IsRegex re s, Functor m, Monad m) => s -> m re
- Text.RE.PCRE.String: makeRegexWith :: (IsRegex re s, Functor m, Monad m) => SimpleREOptions -> s -> m re
- Text.RE.PCRE.String: makeSearchReplace :: (IsRegex re s, Functor m, Monad m, IsRegex re s) => s -> s -> m (SearchReplace re s)
- Text.RE.PCRE.String: makeSearchReplaceWith :: (IsRegex re s, Functor m, Monad m, IsRegex re s) => SimpleREOptions -> s -> s -> m (SearchReplace re s)
- Text.RE.PCRE.String: matchMany :: IsRegex re s => re -> s -> Matches s
- Text.RE.PCRE.String: matchOnce :: IsRegex re s => re -> s -> Match s
- Text.RE.PCRE.String: regexSource :: IsRegex re s => re -> s
- Text.RE.ZeInternals.PCRE: class IsOption o
- Text.RE.ZeInternals.PCRE: compileRegex :: (Functor m, Monad m) => String -> m RE
- Text.RE.ZeInternals.PCRE: compileRegexWith :: (Functor m, Monad m) => SimpleREOptions -> String -> m RE
- Text.RE.ZeInternals.PCRE: compileRegexWithOptions :: (IsOption o, Functor m, Monad m) => o -> String -> m RE
- Text.RE.ZeInternals.PCRE: compileSearchReplace :: (Monad m, Functor m, IsRegex RE s) => String -> String -> m (SearchReplace RE s)
- Text.RE.ZeInternals.PCRE: compileSearchReplaceWith :: (Monad m, Functor m, IsRegex RE s) => SimpleREOptions -> String -> String -> m (SearchReplace RE s)
- Text.RE.ZeInternals.PCRE: compileSearchReplaceWithREOptions :: (Monad m, Functor m, IsRegex RE s) => REOptions -> String -> String -> m (SearchReplace RE s)
- Text.RE.ZeInternals.PCRE: cp :: QuasiQuoter
- Text.RE.ZeInternals.PCRE: data RE
- Text.RE.ZeInternals.PCRE: defaultREOptions :: REOptions
- Text.RE.ZeInternals.PCRE: escape :: (Functor m, Monad m) => (String -> String) -> String -> m RE
- Text.RE.ZeInternals.PCRE: escapeREString :: String -> String
- Text.RE.ZeInternals.PCRE: escapeWith :: (Functor m, Monad m) => SimpleREOptions -> (String -> String) -> String -> m RE
- Text.RE.ZeInternals.PCRE: escapeWithOptions :: (IsOption o, Functor m, Monad m) => o -> (String -> String) -> String -> m RE
- Text.RE.ZeInternals.PCRE: instance Text.RE.ZeInternals.PCRE.IsOption ()
- Text.RE.ZeInternals.PCRE: instance Text.RE.ZeInternals.PCRE.IsOption (Text.RE.REOptions.Macros Text.RE.ZeInternals.PCRE.RE)
- Text.RE.ZeInternals.PCRE: instance Text.RE.ZeInternals.PCRE.IsOption Text.RE.REOptions.SimpleREOptions
- Text.RE.ZeInternals.PCRE: instance Text.RE.ZeInternals.PCRE.IsOption Text.RE.ZeInternals.PCRE.REOptions
- Text.RE.ZeInternals.PCRE: instance Text.RE.ZeInternals.PCRE.IsOption Text.Regex.PCRE.Wrap.CompOption
- Text.RE.ZeInternals.PCRE: instance Text.RE.ZeInternals.PCRE.IsOption Text.Regex.PCRE.Wrap.ExecOption
- Text.RE.ZeInternals.PCRE: makeREOptions :: IsOption o => o -> REOptions
- Text.RE.ZeInternals.PCRE: noPreludeREOptions :: REOptions
- Text.RE.ZeInternals.PCRE: prelude :: Macros RE
- Text.RE.ZeInternals.PCRE: preludeEnv :: MacroEnv
- Text.RE.ZeInternals.PCRE: preludeSource :: PreludeMacro -> String
- Text.RE.ZeInternals.PCRE: preludeSources :: String
- Text.RE.ZeInternals.PCRE: preludeSummary :: PreludeMacro -> String
- Text.RE.ZeInternals.PCRE: preludeTable :: String
- Text.RE.ZeInternals.PCRE: preludeTestsFailing :: [MacroID]
- Text.RE.ZeInternals.PCRE: re :: QuasiQuoter
- Text.RE.ZeInternals.PCRE: reBI :: QuasiQuoter
- Text.RE.ZeInternals.PCRE: reBS :: QuasiQuoter
- Text.RE.ZeInternals.PCRE: reBlockInsensitive :: QuasiQuoter
- Text.RE.ZeInternals.PCRE: reBlockSensitive :: QuasiQuoter
- Text.RE.ZeInternals.PCRE: reCaptureNames :: RE -> CaptureNames
- Text.RE.ZeInternals.PCRE: reMI :: QuasiQuoter
- Text.RE.ZeInternals.PCRE: reMS :: QuasiQuoter
- Text.RE.ZeInternals.PCRE: reMultilineInsensitive :: QuasiQuoter
- Text.RE.ZeInternals.PCRE: reMultilineSensitive :: QuasiQuoter
- Text.RE.ZeInternals.PCRE: reOptions :: RE -> REOptions
- Text.RE.ZeInternals.PCRE: reRegex :: RE -> Regex
- Text.RE.ZeInternals.PCRE: reSource :: RE -> String
- Text.RE.ZeInternals.PCRE: re_ :: QuasiQuoter
- Text.RE.ZeInternals.PCRE: regexType :: RegexType
- Text.RE.ZeInternals.PCRE: type REOptions = REOptions_ RE CompOption ExecOption
- Text.RE.ZeInternals.PCRE: unpackSimpleREOptions :: SimpleREOptions -> REOptions
- Text.RE.ZeInternals.SearchReplace: compileSearchAndReplace_ :: (Monad m, Functor m) => (String -> s) -> (String -> Either String re) -> String -> String -> m (SearchReplace re s)
- Text.RE.ZeInternals.SearchReplace: compileSearchReplace_ :: (Monad m, Functor m) => (String -> s) -> (String -> Either String re) -> String -> m (SearchReplace re s)
- Text.RE.ZeInternals.SearchReplace: unsafeCompileSearchReplace_ :: (String -> s) -> (String -> Either String re) -> String -> SearchReplace re s
- Text.RE.ZeInternals.SearchReplace.PCRE: ed :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE: edBI :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE: edBS :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE: edBlockInsensitive :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE: edBlockSensitive :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE: edMI :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE: edMS :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE: edMultilineInsensitive :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE: edMultilineSensitive :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE: ed_ :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.ByteString: ed :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.ByteString: edBI :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.ByteString: edBS :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.ByteString: edBlockInsensitive :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.ByteString: edBlockSensitive :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.ByteString: edMI :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.ByteString: edMS :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.ByteString: edMultilineInsensitive :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.ByteString: edMultilineSensitive :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.ByteString: ed_ :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy: ed :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy: edBI :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy: edBS :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy: edBlockInsensitive :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy: edBlockSensitive :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy: edMI :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy: edMS :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy: edMultilineInsensitive :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy: edMultilineSensitive :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy: ed_ :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.Sequence: ed :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.Sequence: edBI :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.Sequence: edBS :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.Sequence: edBlockInsensitive :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.Sequence: edBlockSensitive :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.Sequence: edMI :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.Sequence: edMS :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.Sequence: edMultilineInsensitive :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.Sequence: edMultilineSensitive :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.Sequence: ed_ :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.String: ed :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.String: edBI :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.String: edBS :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.String: edBlockInsensitive :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.String: edBlockSensitive :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.String: edMI :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.String: edMS :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.String: edMultilineInsensitive :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.String: edMultilineSensitive :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCRE.String: ed_ :: QuasiQuoter
- Text.RE.ZeInternals.SearchReplace.PCREEdPrime: ed' :: Q Exp -> Maybe SimpleREOptions -> QuasiQuoter
+ Text.RE.PCRE: class IsOption o
+ Text.RE.PCRE: compileRegexWithOptions :: (IsOption o, Functor m, Monad m) => o -> String -> m RE
+ Text.RE.PCRE: compileSearchReplaceWithOptions :: (Monad m, Functor m, IsRegex RE s) => REOptions -> String -> String -> m (SearchReplace RE s)
+ Text.RE.PCRE: cp :: QuasiQuoter
+ Text.RE.PCRE: defaultREOptions :: REOptions
+ Text.RE.PCRE: ed :: QuasiQuoter
+ Text.RE.PCRE: edBI :: QuasiQuoter
+ Text.RE.PCRE: edBS :: QuasiQuoter
+ Text.RE.PCRE: edBlockInsensitive :: QuasiQuoter
+ Text.RE.PCRE: edBlockSensitive :: QuasiQuoter
+ Text.RE.PCRE: edMI :: QuasiQuoter
+ Text.RE.PCRE: edMS :: QuasiQuoter
+ Text.RE.PCRE: edMultilineInsensitive :: QuasiQuoter
+ Text.RE.PCRE: edMultilineSensitive :: QuasiQuoter
+ Text.RE.PCRE: ed_ :: QuasiQuoter
+ Text.RE.PCRE: escapeWithOptions :: (IsOption o, Functor m, Monad m) => o -> (String -> String) -> String -> m RE
+ Text.RE.PCRE: makeREOptions :: IsOption o => o -> REOptions
+ Text.RE.PCRE: noPreludeREOptions :: REOptions
+ Text.RE.PCRE: prelude :: Macros RE
+ Text.RE.PCRE: preludeEnv :: MacroEnv
+ Text.RE.PCRE: preludeSource :: PreludeMacro -> String
+ Text.RE.PCRE: preludeSources :: String
+ Text.RE.PCRE: preludeSummary :: PreludeMacro -> String
+ Text.RE.PCRE: preludeTable :: String
+ Text.RE.PCRE: preludeTestsFailing :: [MacroID]
+ Text.RE.PCRE: re :: QuasiQuoter
+ Text.RE.PCRE: reBI :: QuasiQuoter
+ Text.RE.PCRE: reBS :: QuasiQuoter
+ Text.RE.PCRE: reBlockInsensitive :: QuasiQuoter
+ Text.RE.PCRE: reBlockSensitive :: QuasiQuoter
+ Text.RE.PCRE: reCaptureNames :: RE -> CaptureNames
+ Text.RE.PCRE: reMI :: QuasiQuoter
+ Text.RE.PCRE: reMS :: QuasiQuoter
+ Text.RE.PCRE: reMultilineInsensitive :: QuasiQuoter
+ Text.RE.PCRE: reMultilineSensitive :: QuasiQuoter
+ Text.RE.PCRE: reOptions :: RE -> REOptions
+ Text.RE.PCRE: reRegex :: RE -> Regex
+ Text.RE.PCRE: re_ :: QuasiQuoter
+ Text.RE.PCRE: regexType :: RegexType
+ Text.RE.PCRE: type REOptions = REOptions_ RE CompOption ExecOption
+ Text.RE.PCRE: unpackSimpleREOptions :: SimpleREOptions -> REOptions
+ Text.RE.PCRE.ByteString: cp :: QuasiQuoter
+ Text.RE.PCRE.ByteString: ed :: QuasiQuoter
+ Text.RE.PCRE.ByteString: edBI :: QuasiQuoter
+ Text.RE.PCRE.ByteString: edBS :: QuasiQuoter
+ Text.RE.PCRE.ByteString: edBlockInsensitive :: QuasiQuoter
+ Text.RE.PCRE.ByteString: edBlockSensitive :: QuasiQuoter
+ Text.RE.PCRE.ByteString: edMI :: QuasiQuoter
+ Text.RE.PCRE.ByteString: edMS :: QuasiQuoter
+ Text.RE.PCRE.ByteString: edMultilineInsensitive :: QuasiQuoter
+ Text.RE.PCRE.ByteString: edMultilineSensitive :: QuasiQuoter
+ Text.RE.PCRE.ByteString: ed_ :: QuasiQuoter
+ Text.RE.PCRE.ByteString: re :: QuasiQuoter
+ Text.RE.PCRE.ByteString: reBI :: QuasiQuoter
+ Text.RE.PCRE.ByteString: reBS :: QuasiQuoter
+ Text.RE.PCRE.ByteString: reBlockInsensitive :: QuasiQuoter
+ Text.RE.PCRE.ByteString: reBlockSensitive :: QuasiQuoter
+ Text.RE.PCRE.ByteString: reMI :: QuasiQuoter
+ Text.RE.PCRE.ByteString: reMS :: QuasiQuoter
+ Text.RE.PCRE.ByteString: reMultilineInsensitive :: QuasiQuoter
+ Text.RE.PCRE.ByteString: reMultilineSensitive :: QuasiQuoter
+ Text.RE.PCRE.ByteString: re_ :: QuasiQuoter
+ Text.RE.PCRE.ByteString.Lazy: cp :: QuasiQuoter
+ Text.RE.PCRE.ByteString.Lazy: ed :: QuasiQuoter
+ Text.RE.PCRE.ByteString.Lazy: edBI :: QuasiQuoter
+ Text.RE.PCRE.ByteString.Lazy: edBS :: QuasiQuoter
+ Text.RE.PCRE.ByteString.Lazy: edBlockInsensitive :: QuasiQuoter
+ Text.RE.PCRE.ByteString.Lazy: edBlockSensitive :: QuasiQuoter
+ Text.RE.PCRE.ByteString.Lazy: edMI :: QuasiQuoter
+ Text.RE.PCRE.ByteString.Lazy: edMS :: QuasiQuoter
+ Text.RE.PCRE.ByteString.Lazy: edMultilineInsensitive :: QuasiQuoter
+ Text.RE.PCRE.ByteString.Lazy: edMultilineSensitive :: QuasiQuoter
+ Text.RE.PCRE.ByteString.Lazy: ed_ :: QuasiQuoter
+ Text.RE.PCRE.ByteString.Lazy: re :: QuasiQuoter
+ Text.RE.PCRE.ByteString.Lazy: reBI :: QuasiQuoter
+ Text.RE.PCRE.ByteString.Lazy: reBS :: QuasiQuoter
+ Text.RE.PCRE.ByteString.Lazy: reBlockInsensitive :: QuasiQuoter
+ Text.RE.PCRE.ByteString.Lazy: reBlockSensitive :: QuasiQuoter
+ Text.RE.PCRE.ByteString.Lazy: reMI :: QuasiQuoter
+ Text.RE.PCRE.ByteString.Lazy: reMS :: QuasiQuoter
+ Text.RE.PCRE.ByteString.Lazy: reMultilineInsensitive :: QuasiQuoter
+ Text.RE.PCRE.ByteString.Lazy: reMultilineSensitive :: QuasiQuoter
+ Text.RE.PCRE.ByteString.Lazy: re_ :: QuasiQuoter
+ Text.RE.PCRE.Sequence: cp :: QuasiQuoter
+ Text.RE.PCRE.Sequence: ed :: QuasiQuoter
+ Text.RE.PCRE.Sequence: edBI :: QuasiQuoter
+ Text.RE.PCRE.Sequence: edBS :: QuasiQuoter
+ Text.RE.PCRE.Sequence: edBlockInsensitive :: QuasiQuoter
+ Text.RE.PCRE.Sequence: edBlockSensitive :: QuasiQuoter
+ Text.RE.PCRE.Sequence: edMI :: QuasiQuoter
+ Text.RE.PCRE.Sequence: edMS :: QuasiQuoter
+ Text.RE.PCRE.Sequence: edMultilineInsensitive :: QuasiQuoter
+ Text.RE.PCRE.Sequence: edMultilineSensitive :: QuasiQuoter
+ Text.RE.PCRE.Sequence: ed_ :: QuasiQuoter
+ Text.RE.PCRE.Sequence: re :: QuasiQuoter
+ Text.RE.PCRE.Sequence: reBI :: QuasiQuoter
+ Text.RE.PCRE.Sequence: reBS :: QuasiQuoter
+ Text.RE.PCRE.Sequence: reBlockInsensitive :: QuasiQuoter
+ Text.RE.PCRE.Sequence: reBlockSensitive :: QuasiQuoter
+ Text.RE.PCRE.Sequence: reMI :: QuasiQuoter
+ Text.RE.PCRE.Sequence: reMS :: QuasiQuoter
+ Text.RE.PCRE.Sequence: reMultilineInsensitive :: QuasiQuoter
+ Text.RE.PCRE.Sequence: reMultilineSensitive :: QuasiQuoter
+ Text.RE.PCRE.Sequence: re_ :: QuasiQuoter
+ Text.RE.PCRE.String: cp :: QuasiQuoter
+ Text.RE.PCRE.String: ed :: QuasiQuoter
+ Text.RE.PCRE.String: edBI :: QuasiQuoter
+ Text.RE.PCRE.String: edBS :: QuasiQuoter
+ Text.RE.PCRE.String: edBlockInsensitive :: QuasiQuoter
+ Text.RE.PCRE.String: edBlockSensitive :: QuasiQuoter
+ Text.RE.PCRE.String: edMI :: QuasiQuoter
+ Text.RE.PCRE.String: edMS :: QuasiQuoter
+ Text.RE.PCRE.String: edMultilineInsensitive :: QuasiQuoter
+ Text.RE.PCRE.String: edMultilineSensitive :: QuasiQuoter
+ Text.RE.PCRE.String: ed_ :: QuasiQuoter
+ Text.RE.PCRE.String: re :: QuasiQuoter
+ Text.RE.PCRE.String: reBI :: QuasiQuoter
+ Text.RE.PCRE.String: reBS :: QuasiQuoter
+ Text.RE.PCRE.String: reBlockInsensitive :: QuasiQuoter
+ Text.RE.PCRE.String: reBlockSensitive :: QuasiQuoter
+ Text.RE.PCRE.String: reMI :: QuasiQuoter
+ Text.RE.PCRE.String: reMS :: QuasiQuoter
+ Text.RE.PCRE.String: reMultilineInsensitive :: QuasiQuoter
+ Text.RE.PCRE.String: reMultilineSensitive :: QuasiQuoter
+ Text.RE.PCRE.String: re_ :: QuasiQuoter
- Text.RE.PCRE.ByteString: (=~) :: (Typeable a, RegexContext Regex ByteString a, RegexMaker Regex CompOption ExecOption String) => ByteString -> RE -> a
+ Text.RE.PCRE.ByteString: (=~) :: (Typeable a, RegexContext Regex ByteString a) => ByteString -> RE -> a
- Text.RE.PCRE.ByteString: (=~~) :: (Monad m, Functor m, Typeable a, RegexContext Regex ByteString a, RegexMaker Regex CompOption ExecOption String) => ByteString -> RE -> m a
+ Text.RE.PCRE.ByteString: (=~~) :: (Monad m, Functor m, Typeable a, RegexContext Regex ByteString a) => ByteString -> RE -> m a
- Text.RE.PCRE.ByteString.Lazy: (=~) :: (Typeable a, RegexContext Regex ByteString a, RegexMaker Regex CompOption ExecOption String) => ByteString -> RE -> a
+ Text.RE.PCRE.ByteString.Lazy: (=~) :: (Typeable a, RegexContext Regex ByteString a) => ByteString -> RE -> a
- Text.RE.PCRE.ByteString.Lazy: (=~~) :: (Monad m, Functor m, Typeable a, RegexContext Regex ByteString a, RegexMaker Regex CompOption ExecOption String) => ByteString -> RE -> m a
+ Text.RE.PCRE.ByteString.Lazy: (=~~) :: (Monad m, Functor m, Typeable a, RegexContext Regex ByteString a) => ByteString -> RE -> m a
- Text.RE.PCRE.Sequence: (=~) :: (Typeable a, RegexContext Regex (Seq Char) a, RegexMaker Regex CompOption ExecOption String) => (Seq Char) -> RE -> a
+ Text.RE.PCRE.Sequence: (=~) :: (Typeable a, RegexContext Regex (Seq Char) a) => (Seq Char) -> RE -> a
- Text.RE.PCRE.Sequence: (=~~) :: (Monad m, Functor m, Typeable a, RegexContext Regex (Seq Char) a, RegexMaker Regex CompOption ExecOption String) => (Seq Char) -> RE -> m a
+ Text.RE.PCRE.Sequence: (=~~) :: (Monad m, Functor m, Typeable a, RegexContext Regex (Seq Char) a) => (Seq Char) -> RE -> m a
- Text.RE.PCRE.String: (=~) :: (Typeable a, RegexContext Regex String a, RegexMaker Regex CompOption ExecOption String) => String -> RE -> a
+ Text.RE.PCRE.String: (=~) :: (Typeable a, RegexContext Regex String a) => String -> RE -> a
- Text.RE.PCRE.String: (=~~) :: (Monad m, Functor m, Typeable a, RegexContext Regex String a, RegexMaker Regex CompOption ExecOption String) => String -> RE -> m a
+ Text.RE.PCRE.String: (=~~) :: (Monad m, Functor m, Typeable a, RegexContext Regex String a) => String -> RE -> m a
Files
- README.markdown +2/−2
- Text/RE/PCRE.hs +86/−25
- Text/RE/PCRE/ByteString.hs +60/−16
- Text/RE/PCRE/ByteString/Lazy.hs +60/−16
- Text/RE/PCRE/Sequence.hs +60/−16
- Text/RE/PCRE/String.hs +60/−16
- Text/RE/ZeInternals/PCRE.hs +68/−37
- Text/RE/ZeInternals/SearchReplace.hs +0/−84
- Text/RE/ZeInternals/SearchReplace/PCRE/ByteString.hs +48/−36
- Text/RE/ZeInternals/SearchReplace/PCRE/ByteString/Lazy.hs +48/−36
- Text/RE/ZeInternals/SearchReplace/PCRE/Sequence.hs +48/−36
- Text/RE/ZeInternals/SearchReplace/PCRE/String.hs +48/−36
- Text/RE/ZeInternals/SearchReplace/PCREEdPrime.hs +2/−3
- changelog +13/−1
- regex-with-pcre.cabal +5/−4
README.markdown view
@@ -12,7 +12,7 @@ * regular expression macros including: + a number of useful RE macros; + a test bench for testing and documenting new macro environments;- * built-in support for the TDFA and PCRE backends;+ * built-in support for the TDFA and PCRE back ends; * comprehensive documentation, tutorials and copious examples. @@ -78,7 +78,7 @@ ☒ 2017-04-04 v0.14.0.0 [Move IsOption, rename Find functions](https://github.com/iconnect/regex/milestone/18) - ☐ 2017-04-10 v1.0.0.0 [First stable release](https://github.com/iconnect/regex/milestone/3)+ ☒ 2017-04-10 v1.0.0.0 [First stable release](https://github.com/iconnect/regex/milestone/3) ☐ 2017-08-31 v2.0.0.0 [Fast text replacement with benchmarks](https://github.com/iconnect/regex/milestone/4)
Text/RE/PCRE.hs view
@@ -14,70 +14,114 @@ -- * About this Module -- $about - -- * The Match Operators+ -- * The 'Matches' and 'Match' Operators (*=~) , (?=~)- -- * The SearchReplace Operators+ -- * The 'SearchReplace' Operators , (*=~/) , (?=~/)- -- * Matches+ -- * The 'Matches' Type , Matches , matchesSource , allMatches , anyMatches , countMatches , matches- -- * Match+ -- * The 'Match' Type , Match , matchSource , matched , matchedText+ -- * The Macros and Parsers+ -- $macros+ , module Text.RE.TestBench.Parsers -- * The 'RE' Type , RE+ , regexType+ , reOptions , reSource+ , reCaptureNames+ , reRegex -- * Options -- $options , SimpleREOptions(..)+ , IsOption(..)+ , REOptions+ , defaultREOptions+ , noPreludeREOptions+ , unpackSimpleREOptions -- * Compiling and Escaping REs , SearchReplace(..) , compileRegex , compileRegexWith+ , compileRegexWithOptions , compileSearchReplace , compileSearchReplaceWith+ , compileSearchReplaceWithOptions , escape , escapeWith+ , escapeWithOptions , escapeREString- -- * The Classic rexex-base Match Operators+ -- * The Classic regex-base Match Operators , (=~) , (=~~)- -- * IsRegex- , IsRegex(..)- -- * The Quasi Quoters and Minor Functions+ -- * The re Quasi Quoters -- $re- , module Text.RE.ZeInternals.PCRE+ , re+ , reMultilineSensitive+ , reMultilineInsensitive+ , reBlockSensitive+ , reBlockInsensitive+ , reMS+ , reMI+ , reBS+ , reBI+ , re_+ -- * The Ed Quasi Quoters -- $ed- , module Text.RE.ZeInternals.SearchReplace.PCRE- -- * The Operator Instances+ , ed+ , edMultilineSensitive+ , edMultilineInsensitive+ , edBlockSensitive+ , edBlockInsensitive+ , edMS+ , edMI+ , edBS+ , edBI+ , ed_+ -- * The cp Quasi Quoters+ , cp+ -- * RE Macros Standard Environment+ -- $prelude+ , prelude+ , preludeEnv+ , preludeTestsFailing+ , preludeTable+ , preludeSummary+ , preludeSources+ , preludeSource+ -- * IsRegex+ -- $isregex+ , module Text.RE.Tools.IsRegex+ -- * The IsRegex Instances -- $instances , module Text.RE.PCRE.ByteString , module Text.RE.PCRE.ByteString.Lazy , module Text.RE.PCRE.Sequence , module Text.RE.PCRE.String- ) where - import Text.RE.PCRE.ByteString() import Text.RE.PCRE.ByteString.Lazy() import Text.RE.PCRE.Sequence() import Text.RE.PCRE.String() import Text.RE.REOptions-import Text.RE.ZeInternals.AddCaptureNames+import Text.RE.Replace+import Text.RE.TestBench.Parsers+import Text.RE.Tools.IsRegex+import Text.RE.ZeInternals import Text.RE.ZeInternals.PCRE import Text.RE.ZeInternals.SearchReplace.PCRE-import Text.RE.ZeInternals.Types.IsRegex-import Text.RE.ZeInternals.Types.Match-import Text.RE.ZeInternals.Types.Matches import qualified Text.Regex.Base as B import qualified Text.Regex.PCRE as PCRE @@ -147,16 +191,21 @@ -- $about -- This module provides access to the back end through polymorphic functions -- that operate over all of the String\/Text\/ByteString types supported by the--- PCRE back end. If you don't need this generality you might find it easier--- to work with one of the modules that have been specialised for each of these--- types:+-- back end. The module also provides all of the specialised back-end functionality+-- that will not be needed by most regex clientts. If you don't need this generality+-- then you might want to consider using one of the simpler modules that have been+-- specialised for each of these types: -- -- * "Text.RE.PCRE.ByteString" -- * "Text.RE.PCRE.ByteString.Lazy"--- * "Text.RE.ZeInternals.PCRE" -- * "Text.RE.PCRE.Sequence" -- * "Text.RE.PCRE.String" +-- $macros+-- There are a number of RE macros and corresponding Haskell parsers+-- for parsing the matched text into appropriate Haskell types. See+-- the [Macros Tables](http://regex.uk/macros) for details.+ -- $options -- You can specify different compilation options by appending a -- to the name of an [re| ... |] or [ed| ... \/\/\/ ... |] quasi quoter@@ -167,7 +216,7 @@ -- -- will replace a @foo@ suffix of the argument text, of any -- capitalisation, with a (lower case) @bar@. If you need to specify the--- options dynamically, use the @[re_| ... |]@ and @[red_| ... \/\/\/ ... |]@+-- options dynamically, use the @[re_| ... |]@ and @[ed_| ... \/\/\/ ... |]@ -- quasi quoters, which generate functions that take an 'IsOption' option -- (e.g., a 'SimpleReOptions' value) and yields a 'RE' or 'SearchReplace' -- as apropriate. For example if you have a 'SimpleReOptions' value in@@ -184,8 +233,20 @@ -- specialised back-end types and functions. -- $ed--- The @[ed|.*\/\/\/foo|]@ quasi quoters, with variants for specifing different--- options to the RE compiler (see "Text.RE.REOptions").+-- The -- | the @[ed| ... \/\/\/ ... |]@ quasi quoters; for example,+--+-- @[ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})\/\/\/${d}\/${m}\/${y}|])@+--+-- represents a @SearchReplace@ that will convert a YYYY-MM-DD format date+-- into a DD\/MM\/YYYY format date.+--+-- The only difference betweem these quasi quoters is the RE options that are set,+-- using the same conventions as the @[re| ... |]@ quasi quoters.+-- +-- $isregex+-- The 'IsRegex' class is used to abstact over the different regex back ends and+-- the text types they work with -- see "Text.RE.Tools.IsRegex" for details.+ -- $instances--- These modules merely provide the 'IsRegex' instances.+-- These module exportss merely provide the 'IsRegex' instances.
Text/RE/PCRE/ByteString.hs view
@@ -20,18 +20,21 @@ -- * The 'SearchReplace' Operators , (*=~/) , (?=~/)- -- * Matches+ -- * The 'Matches' Type , Matches , matchesSource , allMatches , anyMatches , countMatches , matches- -- * Match+ -- * The 'Match' Type , Match , matchSource , matched , matchedText+ -- * The Macros and Parsers+ -- $macros+ , module Text.RE.TestBench.Parsers -- * The 'RE' Type , RE , reSource@@ -47,16 +50,38 @@ , escape , escapeWith , escapeREString- -- * The Classic rexex-base Match Operators+ -- * The Classic regex-base Match Operators , (=~) , (=~~)- -- * IsRegex- , IsRegex(..)- -- * The Quasi Quoters and Minor Functions+ -- * The re Quasi Quoters -- $re- , module Text.RE.ZeInternals.PCRE+ , re+ , reMultilineSensitive+ , reMultilineInsensitive+ , reBlockSensitive+ , reBlockInsensitive+ , reMS+ , reMI+ , reBS+ , reBI+ , re_+ -- * The Ed Quasi Quoters -- $ed- , module Text.RE.ZeInternals.SearchReplace.PCRE.ByteString+ , edMultilineSensitive+ , edMultilineInsensitive+ , edBlockSensitive+ , edBlockInsensitive+ , ed+ , edMS+ , edMI+ , edBS+ , edBI+ , ed_+ -- * The cp Quasi Quoters+ , cp+ -- * IsRegex+ -- $isregex+ , module Text.RE.Tools.IsRegex ) where import qualified Data.ByteString as B@@ -64,10 +89,11 @@ import Prelude.Compat import Text.RE.REOptions import Text.RE.Replace-import Text.RE.ZeInternals.AddCaptureNames+import Text.RE.TestBench.Parsers+import Text.RE.Tools.IsRegex+import Text.RE.ZeInternals import Text.RE.ZeInternals.PCRE import Text.RE.ZeInternals.SearchReplace.PCRE.ByteString-import Text.RE.ZeInternals.Types.IsRegex import Text.Regex.Base import qualified Text.Regex.PCRE as PCRE @@ -102,7 +128,7 @@ (*=~/) = flip searchReplaceAll -- | search and replace the first occurrence only (if any) in the input text--- e.g., to prefix the first string of four hex digits in the imput text,+-- e.g., to prefix the first string of four hex digits in the input text, -- if any, with @0x@: -- -- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])@@@ -110,22 +136,20 @@ (?=~/) :: B.ByteString -> SearchReplace RE B.ByteString -> B.ByteString (?=~/) = flip searchReplaceFirst --- | the regex-base polymorphic match operator+-- | the `regex-base` polymorphic match operator (=~) :: ( Typeable a , RegexContext PCRE.Regex B.ByteString a- , RegexMaker PCRE.Regex PCRE.CompOption PCRE.ExecOption String ) => B.ByteString -> RE -> a (=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs --- | the regex-base monadic, polymorphic match operator+-- | the `regex-base` monadic, polymorphic match operator (=~~) :: ( Monad m , Functor m , Typeable a , RegexContext PCRE.Regex B.ByteString a- , RegexMaker PCRE.Regex PCRE.CompOption PCRE.ExecOption String ) => B.ByteString -> RE@@ -142,6 +166,11 @@ -- $tutorial -- We have a regex tutorial at <http://tutorial.regex.uk>. +-- $macros+-- There are a number of RE macros and corresponding Haskell parsers+-- for parsing the matched text into appropriate Haskell types. See+-- the [Macros Tables](http://regex.uk/macros) for details.+ -- $options -- You can specify different compilation options by appending a -- to the name of an [re| ... |] or [ed| ... \/\/\/ ... |] quasi quoter@@ -152,7 +181,7 @@ -- -- will replace a @foo@ suffix of the argument text, of any -- capitalisation, with a (lower case) @bar@. If you need to specify the--- options dynamically, use the @[re_| ... |]@ and @[red_| ... \/\/\/ ... |]@+-- options dynamically, use the @[re_| ... |]@ and @[ed_| ... \/\/\/ ... |]@ -- quasi quoters, which generate functions that take an 'IsOption' option -- (e.g., a 'SimpleReOptions' value) and yields a 'RE' or 'SearchReplace' -- as apropriate. For example if you have a 'SimpleReOptions' value in@@ -171,3 +200,18 @@ -- $ed -- The @[ed|.*\/\/\/foo|]@ quasi quoters, with variants for specifing different -- options to the RE compiler (see "Text.RE.REOptions").++-- $ed+-- The -- | the @[ed| ... \/\/\/ ... |]@ quasi quoters; for example,+--+-- @[ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})\/\/\/${d}\/${m}\/${y}|])@+--+-- represents a @SearchReplace@ that will convert a YYYY-MM-DD format date+-- into a DD\/MM\/YYYY format date.+--+-- The only difference betweem these quasi quoters is the RE options that are set,+-- using the same conventions as the @[re| ... |]@ quasi quoters.++-- $isregex+-- The 'IsRegex' class is used to abstact over the different regex back ends and+-- the text types they work with -- see "Text.RE.Tools.IsRegex" for details.
Text/RE/PCRE/ByteString/Lazy.hs view
@@ -20,18 +20,21 @@ -- * The 'SearchReplace' Operators , (*=~/) , (?=~/)- -- * Matches+ -- * The 'Matches' Type , Matches , matchesSource , allMatches , anyMatches , countMatches , matches- -- * Match+ -- * The 'Match' Type , Match , matchSource , matched , matchedText+ -- * The Macros and Parsers+ -- $macros+ , module Text.RE.TestBench.Parsers -- * The 'RE' Type , RE , reSource@@ -47,16 +50,38 @@ , escape , escapeWith , escapeREString- -- * The Classic rexex-base Match Operators+ -- * The Classic regex-base Match Operators , (=~) , (=~~)- -- * IsRegex- , IsRegex(..)- -- * The Quasi Quoters and Minor Functions+ -- * The re Quasi Quoters -- $re- , module Text.RE.ZeInternals.PCRE+ , re+ , reMultilineSensitive+ , reMultilineInsensitive+ , reBlockSensitive+ , reBlockInsensitive+ , reMS+ , reMI+ , reBS+ , reBI+ , re_+ -- * The Ed Quasi Quoters -- $ed- , module Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy+ , edMultilineSensitive+ , edMultilineInsensitive+ , edBlockSensitive+ , edBlockInsensitive+ , ed+ , edMS+ , edMI+ , edBS+ , edBI+ , ed_+ -- * The cp Quasi Quoters+ , cp+ -- * IsRegex+ -- $isregex+ , module Text.RE.Tools.IsRegex ) where import qualified Data.ByteString.Lazy as LBS@@ -64,10 +89,11 @@ import Prelude.Compat import Text.RE.REOptions import Text.RE.Replace-import Text.RE.ZeInternals.AddCaptureNames+import Text.RE.TestBench.Parsers+import Text.RE.Tools.IsRegex+import Text.RE.ZeInternals import Text.RE.ZeInternals.PCRE import Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy-import Text.RE.ZeInternals.Types.IsRegex import Text.Regex.Base import qualified Text.Regex.PCRE as PCRE @@ -102,7 +128,7 @@ (*=~/) = flip searchReplaceAll -- | search and replace the first occurrence only (if any) in the input text--- e.g., to prefix the first string of four hex digits in the imput text,+-- e.g., to prefix the first string of four hex digits in the input text, -- if any, with @0x@: -- -- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])@@@ -110,22 +136,20 @@ (?=~/) :: LBS.ByteString -> SearchReplace RE LBS.ByteString -> LBS.ByteString (?=~/) = flip searchReplaceFirst --- | the regex-base polymorphic match operator+-- | the `regex-base` polymorphic match operator (=~) :: ( Typeable a , RegexContext PCRE.Regex LBS.ByteString a- , RegexMaker PCRE.Regex PCRE.CompOption PCRE.ExecOption String ) => LBS.ByteString -> RE -> a (=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs --- | the regex-base monadic, polymorphic match operator+-- | the `regex-base` monadic, polymorphic match operator (=~~) :: ( Monad m , Functor m , Typeable a , RegexContext PCRE.Regex LBS.ByteString a- , RegexMaker PCRE.Regex PCRE.CompOption PCRE.ExecOption String ) => LBS.ByteString -> RE@@ -142,6 +166,11 @@ -- $tutorial -- We have a regex tutorial at <http://tutorial.regex.uk>. +-- $macros+-- There are a number of RE macros and corresponding Haskell parsers+-- for parsing the matched text into appropriate Haskell types. See+-- the [Macros Tables](http://regex.uk/macros) for details.+ -- $options -- You can specify different compilation options by appending a -- to the name of an [re| ... |] or [ed| ... \/\/\/ ... |] quasi quoter@@ -152,7 +181,7 @@ -- -- will replace a @foo@ suffix of the argument text, of any -- capitalisation, with a (lower case) @bar@. If you need to specify the--- options dynamically, use the @[re_| ... |]@ and @[red_| ... \/\/\/ ... |]@+-- options dynamically, use the @[re_| ... |]@ and @[ed_| ... \/\/\/ ... |]@ -- quasi quoters, which generate functions that take an 'IsOption' option -- (e.g., a 'SimpleReOptions' value) and yields a 'RE' or 'SearchReplace' -- as apropriate. For example if you have a 'SimpleReOptions' value in@@ -171,3 +200,18 @@ -- $ed -- The @[ed|.*\/\/\/foo|]@ quasi quoters, with variants for specifing different -- options to the RE compiler (see "Text.RE.REOptions").++-- $ed+-- The -- | the @[ed| ... \/\/\/ ... |]@ quasi quoters; for example,+--+-- @[ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})\/\/\/${d}\/${m}\/${y}|])@+--+-- represents a @SearchReplace@ that will convert a YYYY-MM-DD format date+-- into a DD\/MM\/YYYY format date.+--+-- The only difference betweem these quasi quoters is the RE options that are set,+-- using the same conventions as the @[re| ... |]@ quasi quoters.++-- $isregex+-- The 'IsRegex' class is used to abstact over the different regex back ends and+-- the text types they work with -- see "Text.RE.Tools.IsRegex" for details.
Text/RE/PCRE/Sequence.hs view
@@ -20,18 +20,21 @@ -- * The 'SearchReplace' Operators , (*=~/) , (?=~/)- -- * Matches+ -- * The 'Matches' Type , Matches , matchesSource , allMatches , anyMatches , countMatches , matches- -- * Match+ -- * The 'Match' Type , Match , matchSource , matched , matchedText+ -- * The Macros and Parsers+ -- $macros+ , module Text.RE.TestBench.Parsers -- * The 'RE' Type , RE , reSource@@ -47,16 +50,38 @@ , escape , escapeWith , escapeREString- -- * The Classic rexex-base Match Operators+ -- * The Classic regex-base Match Operators , (=~) , (=~~)- -- * IsRegex- , IsRegex(..)- -- * The Quasi Quoters and Minor Functions+ -- * The re Quasi Quoters -- $re- , module Text.RE.ZeInternals.PCRE+ , re+ , reMultilineSensitive+ , reMultilineInsensitive+ , reBlockSensitive+ , reBlockInsensitive+ , reMS+ , reMI+ , reBS+ , reBI+ , re_+ -- * The Ed Quasi Quoters -- $ed- , module Text.RE.ZeInternals.SearchReplace.PCRE.Sequence+ , edMultilineSensitive+ , edMultilineInsensitive+ , edBlockSensitive+ , edBlockInsensitive+ , ed+ , edMS+ , edMI+ , edBS+ , edBI+ , ed_+ -- * The cp Quasi Quoters+ , cp+ -- * IsRegex+ -- $isregex+ , module Text.RE.Tools.IsRegex ) where import qualified Data.Sequence as S@@ -64,10 +89,11 @@ import Prelude.Compat import Text.RE.REOptions import Text.RE.Replace-import Text.RE.ZeInternals.AddCaptureNames+import Text.RE.TestBench.Parsers+import Text.RE.Tools.IsRegex+import Text.RE.ZeInternals import Text.RE.ZeInternals.PCRE import Text.RE.ZeInternals.SearchReplace.PCRE.Sequence-import Text.RE.ZeInternals.Types.IsRegex import Text.Regex.Base import qualified Text.Regex.PCRE as PCRE @@ -102,7 +128,7 @@ (*=~/) = flip searchReplaceAll -- | search and replace the first occurrence only (if any) in the input text--- e.g., to prefix the first string of four hex digits in the imput text,+-- e.g., to prefix the first string of four hex digits in the input text, -- if any, with @0x@: -- -- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])@@@ -110,22 +136,20 @@ (?=~/) :: (S.Seq Char) -> SearchReplace RE (S.Seq Char) -> (S.Seq Char) (?=~/) = flip searchReplaceFirst --- | the regex-base polymorphic match operator+-- | the `regex-base` polymorphic match operator (=~) :: ( Typeable a , RegexContext PCRE.Regex (S.Seq Char) a- , RegexMaker PCRE.Regex PCRE.CompOption PCRE.ExecOption String ) => (S.Seq Char) -> RE -> a (=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs --- | the regex-base monadic, polymorphic match operator+-- | the `regex-base` monadic, polymorphic match operator (=~~) :: ( Monad m , Functor m , Typeable a , RegexContext PCRE.Regex (S.Seq Char) a- , RegexMaker PCRE.Regex PCRE.CompOption PCRE.ExecOption String ) => (S.Seq Char) -> RE@@ -142,6 +166,11 @@ -- $tutorial -- We have a regex tutorial at <http://tutorial.regex.uk>. +-- $macros+-- There are a number of RE macros and corresponding Haskell parsers+-- for parsing the matched text into appropriate Haskell types. See+-- the [Macros Tables](http://regex.uk/macros) for details.+ -- $options -- You can specify different compilation options by appending a -- to the name of an [re| ... |] or [ed| ... \/\/\/ ... |] quasi quoter@@ -152,7 +181,7 @@ -- -- will replace a @foo@ suffix of the argument text, of any -- capitalisation, with a (lower case) @bar@. If you need to specify the--- options dynamically, use the @[re_| ... |]@ and @[red_| ... \/\/\/ ... |]@+-- options dynamically, use the @[re_| ... |]@ and @[ed_| ... \/\/\/ ... |]@ -- quasi quoters, which generate functions that take an 'IsOption' option -- (e.g., a 'SimpleReOptions' value) and yields a 'RE' or 'SearchReplace' -- as apropriate. For example if you have a 'SimpleReOptions' value in@@ -171,3 +200,18 @@ -- $ed -- The @[ed|.*\/\/\/foo|]@ quasi quoters, with variants for specifing different -- options to the RE compiler (see "Text.RE.REOptions").++-- $ed+-- The -- | the @[ed| ... \/\/\/ ... |]@ quasi quoters; for example,+--+-- @[ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})\/\/\/${d}\/${m}\/${y}|])@+--+-- represents a @SearchReplace@ that will convert a YYYY-MM-DD format date+-- into a DD\/MM\/YYYY format date.+--+-- The only difference betweem these quasi quoters is the RE options that are set,+-- using the same conventions as the @[re| ... |]@ quasi quoters.++-- $isregex+-- The 'IsRegex' class is used to abstact over the different regex back ends and+-- the text types they work with -- see "Text.RE.Tools.IsRegex" for details.
Text/RE/PCRE/String.hs view
@@ -20,18 +20,21 @@ -- * The 'SearchReplace' Operators , (*=~/) , (?=~/)- -- * Matches+ -- * The 'Matches' Type , Matches , matchesSource , allMatches , anyMatches , countMatches , matches- -- * Match+ -- * The 'Match' Type , Match , matchSource , matched , matchedText+ -- * The Macros and Parsers+ -- $macros+ , module Text.RE.TestBench.Parsers -- * The 'RE' Type , RE , reSource@@ -47,16 +50,38 @@ , escape , escapeWith , escapeREString- -- * The Classic rexex-base Match Operators+ -- * The Classic regex-base Match Operators , (=~) , (=~~)- -- * IsRegex- , IsRegex(..)- -- * The Quasi Quoters and Minor Functions+ -- * The re Quasi Quoters -- $re- , module Text.RE.ZeInternals.PCRE+ , re+ , reMultilineSensitive+ , reMultilineInsensitive+ , reBlockSensitive+ , reBlockInsensitive+ , reMS+ , reMI+ , reBS+ , reBI+ , re_+ -- * The Ed Quasi Quoters -- $ed- , module Text.RE.ZeInternals.SearchReplace.PCRE.String+ , edMultilineSensitive+ , edMultilineInsensitive+ , edBlockSensitive+ , edBlockInsensitive+ , ed+ , edMS+ , edMI+ , edBS+ , edBI+ , ed_+ -- * The cp Quasi Quoters+ , cp+ -- * IsRegex+ -- $isregex+ , module Text.RE.Tools.IsRegex ) where @@ -64,10 +89,11 @@ import Prelude.Compat import Text.RE.REOptions import Text.RE.Replace-import Text.RE.ZeInternals.AddCaptureNames+import Text.RE.TestBench.Parsers+import Text.RE.Tools.IsRegex+import Text.RE.ZeInternals import Text.RE.ZeInternals.PCRE import Text.RE.ZeInternals.SearchReplace.PCRE.String-import Text.RE.ZeInternals.Types.IsRegex import Text.Regex.Base import qualified Text.Regex.PCRE as PCRE @@ -102,7 +128,7 @@ (*=~/) = flip searchReplaceAll -- | search and replace the first occurrence only (if any) in the input text--- e.g., to prefix the first string of four hex digits in the imput text,+-- e.g., to prefix the first string of four hex digits in the input text, -- if any, with @0x@: -- -- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])@@@ -110,22 +136,20 @@ (?=~/) :: String -> SearchReplace RE String -> String (?=~/) = flip searchReplaceFirst --- | the regex-base polymorphic match operator+-- | the `regex-base` polymorphic match operator (=~) :: ( Typeable a , RegexContext PCRE.Regex String a- , RegexMaker PCRE.Regex PCRE.CompOption PCRE.ExecOption String ) => String -> RE -> a (=~) bs rex = addCaptureNames (reCaptureNames rex) $ match (reRegex rex) bs --- | the regex-base monadic, polymorphic match operator+-- | the `regex-base` monadic, polymorphic match operator (=~~) :: ( Monad m , Functor m , Typeable a , RegexContext PCRE.Regex String a- , RegexMaker PCRE.Regex PCRE.CompOption PCRE.ExecOption String ) => String -> RE@@ -142,6 +166,11 @@ -- $tutorial -- We have a regex tutorial at <http://tutorial.regex.uk>. +-- $macros+-- There are a number of RE macros and corresponding Haskell parsers+-- for parsing the matched text into appropriate Haskell types. See+-- the [Macros Tables](http://regex.uk/macros) for details.+ -- $options -- You can specify different compilation options by appending a -- to the name of an [re| ... |] or [ed| ... \/\/\/ ... |] quasi quoter@@ -152,7 +181,7 @@ -- -- will replace a @foo@ suffix of the argument text, of any -- capitalisation, with a (lower case) @bar@. If you need to specify the--- options dynamically, use the @[re_| ... |]@ and @[red_| ... \/\/\/ ... |]@+-- options dynamically, use the @[re_| ... |]@ and @[ed_| ... \/\/\/ ... |]@ -- quasi quoters, which generate functions that take an 'IsOption' option -- (e.g., a 'SimpleReOptions' value) and yields a 'RE' or 'SearchReplace' -- as apropriate. For example if you have a 'SimpleReOptions' value in@@ -171,3 +200,18 @@ -- $ed -- The @[ed|.*\/\/\/foo|]@ quasi quoters, with variants for specifing different -- options to the RE compiler (see "Text.RE.REOptions").++-- $ed+-- The -- | the @[ed| ... \/\/\/ ... |]@ quasi quoters; for example,+--+-- @[ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})\/\/\/${d}\/${m}\/${y}|])@+--+-- represents a @SearchReplace@ that will convert a YYYY-MM-DD format date+-- into a DD\/MM\/YYYY format date.+--+-- The only difference betweem these quasi quoters is the RE options that are set,+-- using the same conventions as the @[re| ... |]@ quasi quoters.++-- $isregex+-- The 'IsRegex' class is used to abstact over the different regex back ends and+-- the text types they work with -- see "Text.RE.Tools.IsRegex" for details.
Text/RE/ZeInternals/PCRE.hs view
@@ -30,6 +30,7 @@ , REOptions , defaultREOptions , noPreludeREOptions+ , unpackSimpleREOptions -- * Compiling Regular Expressions , compileRegex , compileRegexWith@@ -37,7 +38,7 @@ -- * Compiling Search-Replace Templates , compileSearchReplace , compileSearchReplaceWith- , compileSearchReplaceWithREOptions+ , compileSearchReplaceWithOptions -- * Escaping String , escape , escapeWith@@ -51,7 +52,6 @@ , preludeSummary , preludeSources , preludeSource- , unpackSimpleREOptions -- * The Quasi Quoters , re , reMS@@ -72,15 +72,10 @@ import Language.Haskell.TH.Quote import Prelude.Compat import Text.RE.REOptions-import Text.RE.ZeInternals.EscapeREString-import Text.RE.ZeInternals.NamedCaptures-import Text.RE.ZeInternals.PreludeMacros-import Text.RE.ZeInternals.QQ-import Text.RE.ZeInternals.Replace-import Text.RE.ZeInternals.SearchReplace-import Text.RE.ZeInternals.TestBench-import Text.RE.ZeInternals.Types.CaptureID-import Text.RE.ZeInternals.Types.IsRegex+import Text.RE.Replace+import Text.RE.TestBench+import Text.RE.Tools+import Text.RE.ZeInternals import Text.Regex.PCRE @@ -96,7 +91,7 @@ -- | some functions in the "Text.RE.TestBench" need the back end to -- be passed dynamically as a 'RegexType' parameters: use 'regexType'--- fpr this backend+-- fpr this back end regexType :: RegexType regexType = mkPCRE $ \txt env md -> txt =~ mdRegexSource regexType ExclCaptures env md@@ -231,12 +226,12 @@ -- | compile a SearchReplace template, with general options, generating -- errors if the RE or the template are not well formed, all capture -- references being checked-compileSearchReplaceWithREOptions :: (Monad m,Functor m,IsRegex RE s)- => REOptions- -> String- -> String- -> m (SearchReplace RE s)-compileSearchReplaceWithREOptions os = compileSearchAndReplace_ packR $ compileRegexWithOptions os+compileSearchReplaceWithOptions :: (Monad m,Functor m,IsRegex RE s)+ => REOptions+ -> String+ -> String+ -> m (SearchReplace RE s)+compileSearchReplaceWithOptions os = compileSearchAndReplace_ packR $ compileRegexWithOptions os ------------------------------------------------------------------------@@ -277,26 +272,37 @@ -- Macro Standard Environment ------------------------------------------------------------------------ +-- | the standard table of 'Macros' used to compile REs (which can be+-- extended or replace: see "Text.RE.TestBench") prelude :: Macros RE prelude = runIdentity $ preludeMacros mk regexType ExclCaptures where mk = Identity . unsafeCompileRegex_ noPreludeREOptions -preludeTestsFailing :: [MacroID]-preludeTestsFailing = badMacros preludeEnv-+-- | the standard 'MacroEnv' for this back end (see "Text.RE.TestBench") preludeEnv :: MacroEnv preludeEnv = preludeMacroEnv regexType +-- | the macros in the standard environment that are failing their tests+-- (checked by the test suite to be empty)+preludeTestsFailing :: [MacroID]+preludeTestsFailing = badMacros preludeEnv++-- | a table the standard macros in markdown format preludeTable :: String preludeTable = preludeMacroTable regexType +-- | a summary of the macros in the standard environment for this back+-- end in plain text preludeSummary :: PreludeMacro -> String preludeSummary = preludeMacroSummary regexType +-- | a listing of the RE text for each macro in the standard environment+-- with all macros expanded to normal form preludeSources :: String preludeSources = preludeMacroSources regexType +-- | the prolude source of a given macro in the standard environment preludeSource :: PreludeMacro -> String preludeSource = preludeMacroSource regexType @@ -305,27 +311,52 @@ -- Quasi Quoters ------------------------------------------------------------------------ --- | the @[re| ... |]@ and @[ed| ... /// ... |]@ quasi quoters-re- , reMS- , reMI- , reBS- , reBI- , reMultilineSensitive- , reMultilineInsensitive- , reBlockSensitive- , reBlockInsensitive- , re_ :: QuasiQuoter-+-- | @[re| ... |]@, is equivalent to @[reMultilineSensitive| ... |]@,+-- compiling a case-sensitive, multi-line RE+re :: QuasiQuoter re = re' $ Just minBound-reMS = reMultilineSensitive-reMI = reMultilineInsensitive-reBS = reBlockSensitive-reBI = reBlockInsensitive++-- | @[reMultilineSensitive| ... |]@, compiles a case-sensitive, multi-line RE+reMultilineSensitive :: QuasiQuoter reMultilineSensitive = re' $ Just MultilineSensitive++-- | @[reMultilineInsensitive| ... |]@, compiles a case-insensitive, multi-line RE+reMultilineInsensitive :: QuasiQuoter reMultilineInsensitive = re' $ Just MultilineInsensitive++-- | @[reMultilineInsensitive| ... |]@, compiles a case-sensitive, non-multi-line RE+reBlockSensitive :: QuasiQuoter reBlockSensitive = re' $ Just BlockSensitive++-- | @[reMultilineInsensitive| ... |]@, compiles a case-insensitive, non-multi-line RE+reBlockInsensitive :: QuasiQuoter reBlockInsensitive = re' $ Just BlockInsensitive++-- | @[reMS| ... |]@ is a shorthand for @[reMultilineSensitive| ... |]@+reMS :: QuasiQuoter+reMS = reMultilineSensitive++-- | @[reMI| ... |]@ is a shorthand for @[reMultilineInsensitive| ... |]@+reMI :: QuasiQuoter+reMI = reMultilineInsensitive++-- | @[reBS| ... |]@ is a shorthand for @[reBlockSensitive| ... |]@+reBS :: QuasiQuoter+reBS = reBlockSensitive++-- | @[reBI| ... |]@ is a shorthand for @[reBlockInsensitive| ... |]@+reBI :: QuasiQuoter+reBI = reBlockInsensitive++-- | @[re_| ... |]@ compiles a RE to produce a function that takes+-- the RE options (e.g., a 'SimpleREOptions' value) and yields the+-- RE compiled with those options. For example,+--+-- @countMatches $ s *=~ [re_|[0-9a-f]+|] MultilineInsensitive@+--+-- counts the number of hexadecimal digit strings in 's', allowing+-- upper- or lower-case hex didgits.+re_ :: QuasiQuoter re_ = re' Nothing
− Text/RE/ZeInternals/SearchReplace.hs
@@ -1,84 +0,0 @@-{-# LANGUAGE NoImplicitPrelude #-}-{-# LANGUAGE RecordWildCards #-}-{-# LANGUAGE CPP #-}-#if __GLASGOW_HASKELL__ >= 800-{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}-{-# LANGUAGE TemplateHaskellQuotes #-}-#else-{-# LANGUAGE QuasiQuotes #-}-{-# LANGUAGE TemplateHaskell #-}-#endif-{-# OPTIONS_GHC -fno-warn-orphans #-}--module Text.RE.ZeInternals.SearchReplace- ( unsafeCompileSearchReplace_- , compileSearchReplace_- , compileSearchAndReplace_- ) where--import qualified Data.HashMap.Strict as HMS-import Prelude.Compat-import Text.RE.ZeInternals.NamedCaptures-import Text.RE.ZeInternals.Replace-import Text.RE.ZeInternals.Types.Capture-import Text.RE.ZeInternals.Types.CaptureID-import Text.RE.ZeInternals.Types.Matches-import Text.RE.ZeInternals.Types.SearchReplace-import qualified Text.Regex.TDFA as TDFA----- | warapper on 'compileSearchReplace_' that will generate an error--- if any compilation errors are found-unsafeCompileSearchReplace_ :: (String->s)- -> (String->Either String re)- -> String- -> SearchReplace re s-unsafeCompileSearchReplace_ pk cf = either err id . compileSearchReplace_ pk cf- where- err msg = error $ "unsafeCompileSearchReplace_: " ++ msg---- | compile a SearchReplace template generating errors if the RE or--- the template are not well formed -- all capture references being checked-compileSearchReplace_ :: (Monad m,Functor m)- => (String->s)- -> (String->Either String re)- -> String- -> m (SearchReplace re s)-compileSearchReplace_ pack compile_re sr_tpl = either fail return $ do- case mainCaptures $ sr_tpl $=~ "///" of- [cap] ->- compileSearchAndReplace_ pack compile_re- (capturePrefix cap) (captureSuffix cap)- _ -> Left $ "bad search-replace template syntax: " ++ sr_tpl---- | compile 'SearcgReplace' from two strings containing the RE--- and the replacement template-compileSearchAndReplace_ :: (Monad m,Functor m)- => (String->s)- -> (String->Either String re)- -> String- -> String- -> m (SearchReplace re s)-compileSearchAndReplace_ pack compile_re re_s tpl = either fail return $ do- re <- compile_re re_s- ((n,cnms),_) <- extractNamedCaptures re_s- mapM_ (check n cnms) $ templateCaptures id tpl- return $ SearchReplace re $ pack tpl- where- check :: Int -> CaptureNames -> CaptureID -> Either String ()- check n cnms cid = case cid of- IsCaptureOrdinal co -> check_co n co- IsCaptureName cn -> check_cn cnms cn-- check_co n (CaptureOrdinal i) = case i <= n of- True -> return ()- False -> Left $ "capture ordinal out of range: " ++- show i ++ " >= " ++ show n-- check_cn cnms cnm = case cnm `HMS.member` cnms of- True -> return ()- False -> Left $ "capture name not defined: " ++- show (getCaptureName cnm)--($=~) :: String -> String -> Matches String-($=~) = (TDFA.=~)
Text/RE/ZeInternals/SearchReplace/PCRE/ByteString.hs view
@@ -7,17 +7,15 @@ #endif module Text.RE.ZeInternals.SearchReplace.PCRE.ByteString- ( -- * The ed Quasi Quoters- -- $qq- ed- , edMS- , edMI- , edBS- , edBI+ ( ed , edMultilineSensitive , edMultilineInsensitive , edBlockSensitive , edBlockInsensitive+ , edMS+ , edMI+ , edBS+ , edBI , ed_ ) where @@ -25,47 +23,61 @@ import Language.Haskell.TH import Language.Haskell.TH.Quote import Text.RE.REOptions+import Text.RE.Tools.IsRegex import Text.RE.ZeInternals.PCRE import Text.RE.ZeInternals.SearchReplace.PCREEdPrime-import Text.RE.ZeInternals.Types.SearchReplace +-- | @[ed| ... \/\/\/ ... |]@, is equivalent to @[edMultilineSensitive| ... \/\/\/ ... |]@,+-- compiling a case-sensitive, multi-line 'SearchReplace'+ed :: QuasiQuoter+ed = ed' sr_cast $ Just minBound -ed- , edMS- , edMI- , edBS- , edBI- , edMultilineSensitive- , edMultilineInsensitive- , edBlockSensitive- , edBlockInsensitive- , ed_ :: QuasiQuoter+-- | @[edMultilineSensitive| ... \/\/\/ ... |]@ compiles a case-sensitive, multi-line 'SearchReplace' template+edMultilineSensitive :: QuasiQuoter+edMultilineSensitive = ed' sr_cast $ Just MultilineSensitive -ed = ed' sr_cast $ Just minBound+-- | @[edMultilineInsensitive| ... \/\/\/ ... |]@ compiles a case-insensitive, multi-line 'SearchReplace' template+edMultilineInsensitive :: QuasiQuoter+edMultilineInsensitive = ed' sr_cast $ Just MultilineInsensitive++-- | @[edBlockSensitive| ... \/\/\/ ... |]@ compiles a case-sensitive, non-multi-line 'SearchReplace' template+edBlockSensitive :: QuasiQuoter+edBlockSensitive = ed' sr_cast $ Just BlockSensitive++-- | @[edBlockInsensitive| ... \/\/\/ ... |]@ compiles a case-insensitive, non-multi-line 'SearchReplace' template+edBlockInsensitive :: QuasiQuoter+edBlockInsensitive = ed' sr_cast $ Just BlockInsensitive++-- | @[edMS| ... \/\/\/ ... |]@ is a shorthand for @[edMultilineSensitive| ... \/\/\/ ... |]@+edMS :: QuasiQuoter edMS = edMultilineSensitive++-- | @[edMI| ... \/\/\/ ... |]@ is a shorthand for @[edMultilineInsensitive| ... \/\/\/ ... |]@+edMI :: QuasiQuoter edMI = edMultilineInsensitive++-- | @[edBS| ... \/\/\/ ... |]@ is a shorthand for @[edBlockSensitive| ... \/\/\/ ... |]@+edBS :: QuasiQuoter edBS = edBlockSensitive++-- | @[edBI| ... \/\/\/ ... |]@ is a shorthand for @[edBlockInsensitive| ... \/\/\/ ... |]@+edBI :: QuasiQuoter edBI = edBlockInsensitive-edMultilineSensitive = ed' sr_cast $ Just MultilineSensitive-edMultilineInsensitive = ed' sr_cast $ Just MultilineInsensitive-edBlockSensitive = ed' sr_cast $ Just BlockSensitive-edBlockInsensitive = ed' sr_cast $ Just BlockInsensitive++-- | @[ed_| ... \/\/\/ ... |]@ compiles a 'SearchReplace' template to produce a function that+-- takes the RE options (e.g., a 'SimpleREOptions' value) and yields the+-- 'SearchReplace' template compiled with those options. For example,+--+-- @s *=~/ [ed_|${hex}([0-9a-f]+)\/\/\/0x${hex}|] MultilineInsensitive@+--+-- prefixes the hexadecimal digit strings in s with @0x@, allowing for+-- upper- or lower-case hex didgits (which is entirely equivalent+-- in this example to just using @[edMultilineInsensitive|[0-9a-f]+|]@).+ed_ :: QuasiQuoter ed_ = ed' fn_cast Nothing sr_cast :: Q Exp sr_cast = [|\x -> x :: SearchReplace RE B.ByteString|] fn_cast :: Q Exp-fn_cast = [|\x -> x :: SimpleREOptions -> SearchReplace RE B.ByteString|]---- $qq--- The -- | the @[ed| ... \/\/\/ ... |]@ quasi quoters; for exaple,------ @[ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})\/\/\/${d}\/${m}\/${y}|])@------ represents a @SearchReplace@ that will convert a YYYY-MM-DD format date--- into a DD\/MM\/YYYY format date.------ The only difference betweem these quasi quoters is the RE options that are set:--- see the "Text.RE.REOptions" documentation for details.---+fn_cast = [|\f x -> f x :: SearchReplace RE B.ByteString|]
Text/RE/ZeInternals/SearchReplace/PCRE/ByteString/Lazy.hs view
@@ -7,17 +7,15 @@ #endif module Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy- ( -- * The ed Quasi Quoters- -- $qq- ed- , edMS- , edMI- , edBS- , edBI+ ( ed , edMultilineSensitive , edMultilineInsensitive , edBlockSensitive , edBlockInsensitive+ , edMS+ , edMI+ , edBS+ , edBI , ed_ ) where @@ -25,47 +23,61 @@ import Language.Haskell.TH import Language.Haskell.TH.Quote import Text.RE.REOptions+import Text.RE.Tools.IsRegex import Text.RE.ZeInternals.PCRE import Text.RE.ZeInternals.SearchReplace.PCREEdPrime-import Text.RE.ZeInternals.Types.SearchReplace +-- | @[ed| ... \/\/\/ ... |]@, is equivalent to @[edMultilineSensitive| ... \/\/\/ ... |]@,+-- compiling a case-sensitive, multi-line 'SearchReplace'+ed :: QuasiQuoter+ed = ed' sr_cast $ Just minBound -ed- , edMS- , edMI- , edBS- , edBI- , edMultilineSensitive- , edMultilineInsensitive- , edBlockSensitive- , edBlockInsensitive- , ed_ :: QuasiQuoter+-- | @[edMultilineSensitive| ... \/\/\/ ... |]@ compiles a case-sensitive, multi-line 'SearchReplace' template+edMultilineSensitive :: QuasiQuoter+edMultilineSensitive = ed' sr_cast $ Just MultilineSensitive -ed = ed' sr_cast $ Just minBound+-- | @[edMultilineInsensitive| ... \/\/\/ ... |]@ compiles a case-insensitive, multi-line 'SearchReplace' template+edMultilineInsensitive :: QuasiQuoter+edMultilineInsensitive = ed' sr_cast $ Just MultilineInsensitive++-- | @[edBlockSensitive| ... \/\/\/ ... |]@ compiles a case-sensitive, non-multi-line 'SearchReplace' template+edBlockSensitive :: QuasiQuoter+edBlockSensitive = ed' sr_cast $ Just BlockSensitive++-- | @[edBlockInsensitive| ... \/\/\/ ... |]@ compiles a case-insensitive, non-multi-line 'SearchReplace' template+edBlockInsensitive :: QuasiQuoter+edBlockInsensitive = ed' sr_cast $ Just BlockInsensitive++-- | @[edMS| ... \/\/\/ ... |]@ is a shorthand for @[edMultilineSensitive| ... \/\/\/ ... |]@+edMS :: QuasiQuoter edMS = edMultilineSensitive++-- | @[edMI| ... \/\/\/ ... |]@ is a shorthand for @[edMultilineInsensitive| ... \/\/\/ ... |]@+edMI :: QuasiQuoter edMI = edMultilineInsensitive++-- | @[edBS| ... \/\/\/ ... |]@ is a shorthand for @[edBlockSensitive| ... \/\/\/ ... |]@+edBS :: QuasiQuoter edBS = edBlockSensitive++-- | @[edBI| ... \/\/\/ ... |]@ is a shorthand for @[edBlockInsensitive| ... \/\/\/ ... |]@+edBI :: QuasiQuoter edBI = edBlockInsensitive-edMultilineSensitive = ed' sr_cast $ Just MultilineSensitive-edMultilineInsensitive = ed' sr_cast $ Just MultilineInsensitive-edBlockSensitive = ed' sr_cast $ Just BlockSensitive-edBlockInsensitive = ed' sr_cast $ Just BlockInsensitive++-- | @[ed_| ... \/\/\/ ... |]@ compiles a 'SearchReplace' template to produce a function that+-- takes the RE options (e.g., a 'SimpleREOptions' value) and yields the+-- 'SearchReplace' template compiled with those options. For example,+--+-- @s *=~/ [ed_|${hex}([0-9a-f]+)\/\/\/0x${hex}|] MultilineInsensitive@+--+-- prefixes the hexadecimal digit strings in s with @0x@, allowing for+-- upper- or lower-case hex didgits (which is entirely equivalent+-- in this example to just using @[edMultilineInsensitive|[0-9a-f]+|]@).+ed_ :: QuasiQuoter ed_ = ed' fn_cast Nothing sr_cast :: Q Exp sr_cast = [|\x -> x :: SearchReplace RE LBS.ByteString|] fn_cast :: Q Exp-fn_cast = [|\x -> x :: SimpleREOptions -> SearchReplace RE LBS.ByteString|]---- $qq--- The -- | the @[ed| ... \/\/\/ ... |]@ quasi quoters; for exaple,------ @[ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})\/\/\/${d}\/${m}\/${y}|])@------ represents a @SearchReplace@ that will convert a YYYY-MM-DD format date--- into a DD\/MM\/YYYY format date.------ The only difference betweem these quasi quoters is the RE options that are set:--- see the "Text.RE.REOptions" documentation for details.---+fn_cast = [|\f x -> f x :: SearchReplace RE LBS.ByteString|]
Text/RE/ZeInternals/SearchReplace/PCRE/Sequence.hs view
@@ -7,17 +7,15 @@ #endif module Text.RE.ZeInternals.SearchReplace.PCRE.Sequence- ( -- * The ed Quasi Quoters- -- $qq- ed- , edMS- , edMI- , edBS- , edBI+ ( ed , edMultilineSensitive , edMultilineInsensitive , edBlockSensitive , edBlockInsensitive+ , edMS+ , edMI+ , edBS+ , edBI , ed_ ) where @@ -25,47 +23,61 @@ import Language.Haskell.TH import Language.Haskell.TH.Quote import Text.RE.REOptions+import Text.RE.Tools.IsRegex import Text.RE.ZeInternals.PCRE import Text.RE.ZeInternals.SearchReplace.PCREEdPrime-import Text.RE.ZeInternals.Types.SearchReplace +-- | @[ed| ... \/\/\/ ... |]@, is equivalent to @[edMultilineSensitive| ... \/\/\/ ... |]@,+-- compiling a case-sensitive, multi-line 'SearchReplace'+ed :: QuasiQuoter+ed = ed' sr_cast $ Just minBound -ed- , edMS- , edMI- , edBS- , edBI- , edMultilineSensitive- , edMultilineInsensitive- , edBlockSensitive- , edBlockInsensitive- , ed_ :: QuasiQuoter+-- | @[edMultilineSensitive| ... \/\/\/ ... |]@ compiles a case-sensitive, multi-line 'SearchReplace' template+edMultilineSensitive :: QuasiQuoter+edMultilineSensitive = ed' sr_cast $ Just MultilineSensitive -ed = ed' sr_cast $ Just minBound+-- | @[edMultilineInsensitive| ... \/\/\/ ... |]@ compiles a case-insensitive, multi-line 'SearchReplace' template+edMultilineInsensitive :: QuasiQuoter+edMultilineInsensitive = ed' sr_cast $ Just MultilineInsensitive++-- | @[edBlockSensitive| ... \/\/\/ ... |]@ compiles a case-sensitive, non-multi-line 'SearchReplace' template+edBlockSensitive :: QuasiQuoter+edBlockSensitive = ed' sr_cast $ Just BlockSensitive++-- | @[edBlockInsensitive| ... \/\/\/ ... |]@ compiles a case-insensitive, non-multi-line 'SearchReplace' template+edBlockInsensitive :: QuasiQuoter+edBlockInsensitive = ed' sr_cast $ Just BlockInsensitive++-- | @[edMS| ... \/\/\/ ... |]@ is a shorthand for @[edMultilineSensitive| ... \/\/\/ ... |]@+edMS :: QuasiQuoter edMS = edMultilineSensitive++-- | @[edMI| ... \/\/\/ ... |]@ is a shorthand for @[edMultilineInsensitive| ... \/\/\/ ... |]@+edMI :: QuasiQuoter edMI = edMultilineInsensitive++-- | @[edBS| ... \/\/\/ ... |]@ is a shorthand for @[edBlockSensitive| ... \/\/\/ ... |]@+edBS :: QuasiQuoter edBS = edBlockSensitive++-- | @[edBI| ... \/\/\/ ... |]@ is a shorthand for @[edBlockInsensitive| ... \/\/\/ ... |]@+edBI :: QuasiQuoter edBI = edBlockInsensitive-edMultilineSensitive = ed' sr_cast $ Just MultilineSensitive-edMultilineInsensitive = ed' sr_cast $ Just MultilineInsensitive-edBlockSensitive = ed' sr_cast $ Just BlockSensitive-edBlockInsensitive = ed' sr_cast $ Just BlockInsensitive++-- | @[ed_| ... \/\/\/ ... |]@ compiles a 'SearchReplace' template to produce a function that+-- takes the RE options (e.g., a 'SimpleREOptions' value) and yields the+-- 'SearchReplace' template compiled with those options. For example,+--+-- @s *=~/ [ed_|${hex}([0-9a-f]+)\/\/\/0x${hex}|] MultilineInsensitive@+--+-- prefixes the hexadecimal digit strings in s with @0x@, allowing for+-- upper- or lower-case hex didgits (which is entirely equivalent+-- in this example to just using @[edMultilineInsensitive|[0-9a-f]+|]@).+ed_ :: QuasiQuoter ed_ = ed' fn_cast Nothing sr_cast :: Q Exp sr_cast = [|\x -> x :: SearchReplace RE (S.Seq Char)|] fn_cast :: Q Exp-fn_cast = [|\x -> x :: SimpleREOptions -> SearchReplace RE (S.Seq Char)|]---- $qq--- The -- | the @[ed| ... \/\/\/ ... |]@ quasi quoters; for exaple,------ @[ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})\/\/\/${d}\/${m}\/${y}|])@------ represents a @SearchReplace@ that will convert a YYYY-MM-DD format date--- into a DD\/MM\/YYYY format date.------ The only difference betweem these quasi quoters is the RE options that are set:--- see the "Text.RE.REOptions" documentation for details.---+fn_cast = [|\f x -> f x :: SearchReplace RE (S.Seq Char)|]
Text/RE/ZeInternals/SearchReplace/PCRE/String.hs view
@@ -7,17 +7,15 @@ #endif module Text.RE.ZeInternals.SearchReplace.PCRE.String- ( -- * The ed Quasi Quoters- -- $qq- ed- , edMS- , edMI- , edBS- , edBI+ ( ed , edMultilineSensitive , edMultilineInsensitive , edBlockSensitive , edBlockInsensitive+ , edMS+ , edMI+ , edBS+ , edBI , ed_ ) where @@ -25,47 +23,61 @@ import Language.Haskell.TH import Language.Haskell.TH.Quote import Text.RE.REOptions+import Text.RE.Tools.IsRegex import Text.RE.ZeInternals.PCRE import Text.RE.ZeInternals.SearchReplace.PCREEdPrime-import Text.RE.ZeInternals.Types.SearchReplace +-- | @[ed| ... \/\/\/ ... |]@, is equivalent to @[edMultilineSensitive| ... \/\/\/ ... |]@,+-- compiling a case-sensitive, multi-line 'SearchReplace'+ed :: QuasiQuoter+ed = ed' sr_cast $ Just minBound -ed- , edMS- , edMI- , edBS- , edBI- , edMultilineSensitive- , edMultilineInsensitive- , edBlockSensitive- , edBlockInsensitive- , ed_ :: QuasiQuoter+-- | @[edMultilineSensitive| ... \/\/\/ ... |]@ compiles a case-sensitive, multi-line 'SearchReplace' template+edMultilineSensitive :: QuasiQuoter+edMultilineSensitive = ed' sr_cast $ Just MultilineSensitive -ed = ed' sr_cast $ Just minBound+-- | @[edMultilineInsensitive| ... \/\/\/ ... |]@ compiles a case-insensitive, multi-line 'SearchReplace' template+edMultilineInsensitive :: QuasiQuoter+edMultilineInsensitive = ed' sr_cast $ Just MultilineInsensitive++-- | @[edBlockSensitive| ... \/\/\/ ... |]@ compiles a case-sensitive, non-multi-line 'SearchReplace' template+edBlockSensitive :: QuasiQuoter+edBlockSensitive = ed' sr_cast $ Just BlockSensitive++-- | @[edBlockInsensitive| ... \/\/\/ ... |]@ compiles a case-insensitive, non-multi-line 'SearchReplace' template+edBlockInsensitive :: QuasiQuoter+edBlockInsensitive = ed' sr_cast $ Just BlockInsensitive++-- | @[edMS| ... \/\/\/ ... |]@ is a shorthand for @[edMultilineSensitive| ... \/\/\/ ... |]@+edMS :: QuasiQuoter edMS = edMultilineSensitive++-- | @[edMI| ... \/\/\/ ... |]@ is a shorthand for @[edMultilineInsensitive| ... \/\/\/ ... |]@+edMI :: QuasiQuoter edMI = edMultilineInsensitive++-- | @[edBS| ... \/\/\/ ... |]@ is a shorthand for @[edBlockSensitive| ... \/\/\/ ... |]@+edBS :: QuasiQuoter edBS = edBlockSensitive++-- | @[edBI| ... \/\/\/ ... |]@ is a shorthand for @[edBlockInsensitive| ... \/\/\/ ... |]@+edBI :: QuasiQuoter edBI = edBlockInsensitive-edMultilineSensitive = ed' sr_cast $ Just MultilineSensitive-edMultilineInsensitive = ed' sr_cast $ Just MultilineInsensitive-edBlockSensitive = ed' sr_cast $ Just BlockSensitive-edBlockInsensitive = ed' sr_cast $ Just BlockInsensitive++-- | @[ed_| ... \/\/\/ ... |]@ compiles a 'SearchReplace' template to produce a function that+-- takes the RE options (e.g., a 'SimpleREOptions' value) and yields the+-- 'SearchReplace' template compiled with those options. For example,+--+-- @s *=~/ [ed_|${hex}([0-9a-f]+)\/\/\/0x${hex}|] MultilineInsensitive@+--+-- prefixes the hexadecimal digit strings in s with @0x@, allowing for+-- upper- or lower-case hex didgits (which is entirely equivalent+-- in this example to just using @[edMultilineInsensitive|[0-9a-f]+|]@).+ed_ :: QuasiQuoter ed_ = ed' fn_cast Nothing sr_cast :: Q Exp sr_cast = [|\x -> x :: SearchReplace RE String|] fn_cast :: Q Exp-fn_cast = [|\x -> x :: SimpleREOptions -> SearchReplace RE String|]---- $qq--- The -- | the @[ed| ... \/\/\/ ... |]@ quasi quoters; for exaple,------ @[ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})\/\/\/${d}\/${m}\/${y}|])@------ represents a @SearchReplace@ that will convert a YYYY-MM-DD format date--- into a DD\/MM\/YYYY format date.------ The only difference betweem these quasi quoters is the RE options that are set:--- see the "Text.RE.REOptions" documentation for details.---+fn_cast = [|\f x -> f x :: SearchReplace RE String|]
Text/RE/ZeInternals/SearchReplace/PCREEdPrime.hs view
@@ -18,10 +18,9 @@ import Prelude.Compat import Text.RE.REOptions import Text.RE.Replace+import Text.RE.Tools.IsRegex+import Text.RE.ZeInternals import Text.RE.ZeInternals.PCRE-import Text.RE.ZeInternals.QQ-import Text.RE.ZeInternals.SearchReplace-import Text.RE.ZeInternals.Types.IsRegex -- | construct a quasi quoter from a casting function and @Just sro@
changelog view
@@ -1,5 +1,17 @@ -*-change-log-*- +1.0.0.0 Chris Dornan <chris.dornan@irisconnect.co.uk> 2017-04-10+ * Rewrite tutorials (#113)+ * Add Text.RE.Tools.IsRegex (#122)+ * Include Macro Parsers in Core API (#123)+ * Adjust type of lookupCaptureID and friends (#124)+ * re-prep to handle cast example expressions (#125)+ * Rename compileSearchReplaceWithOptions (#126)+ * Hide ZeInternals, Evacuate Text.RE (#127)+ * Proper Haddocks for the quasi quoters (#128)+ * ed_ quasi quoters are being restricted to SimpleREOptions (#129)+ * regex dependeny on pcre-builtin (#130)+ 0.14.0.0 Chris Dornan <chris.dornan@irisconnect.co.uk> 2017-04-05 * Move IsOption into the back ends (#115) * Rename Find functions (#116)@@ -71,7 +83,7 @@ * Fix .travis.yml release-stack script (#67) 0.6.0.0 Chris Dornan <chris.dornan@irisconnect.co.uk> 2017-03-13- * Split out rexex-with-pcre package (#65)+ * Split out regex-with-pcre package (#65) 0.5.0.0 Chris Dornan <chris.dornan@irisconnect.co.uk> 2017-03-05 * Fix inter-operation of =~ & =~~ and named captures (#55)
regex-with-pcre.cabal view
@@ -1,5 +1,5 @@ Name: regex-with-pcre-Version: 0.14.0.0+Version: 1.0.0.0 Synopsis: Toolkit for regex-base Description: A regular expression toolkit for regex-base with compile-time checking of RE syntax, data types for@@ -32,7 +32,7 @@ Source-Repository this Type: git Location: https://github.com/iconnect/regex.git- Tag: 0.14.0.0+ Tag: 1.0.0.0 @@ -45,8 +45,9 @@ Text.RE.PCRE.ByteString.Lazy Text.RE.PCRE.Sequence Text.RE.PCRE.String++ Other-Modules: Text.RE.ZeInternals.PCRE- Text.RE.ZeInternals.SearchReplace Text.RE.ZeInternals.SearchReplace.PCRE Text.RE.ZeInternals.SearchReplace.PCRE.ByteString Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy@@ -87,7 +88,7 @@ -Wwarn Build-depends:- regex == 0.14.0.0+ regex == 1.0.0.0 , base >= 4 && < 5 , base-compat >= 0.6.0 , bytestring >= 0.10.2.0