packages feed

regex 0.5.0.0 → 0.6.0.0

raw patch · 13 files changed

+67/−774 lines, 13 filesdep −regex-pcre-builtinPVP ok

version bump matches the API change (PVP)

Dependencies removed: regex-pcre-builtin

API changes (from Hackage documentation)

- Text.RE: [allMatches] :: Matches a -> ![Match a]
- Text.RE: [captureLength] :: Capture a -> !Int
- Text.RE: [captureNames] :: Match a -> !CaptureNames
- Text.RE: [captureOffset] :: Capture a -> !Int
- Text.RE: [captureSource] :: Capture a -> !a
- Text.RE: [capturedText] :: Capture a -> !a
- Text.RE: [getCaptureName] :: CaptureName -> Text
- Text.RE: [getCaptureOrdinal] :: CaptureOrdinal -> Int
- Text.RE: [getLineMatches] :: Line -> Matches ByteString
- Text.RE: [getLineNumber] :: Line -> LineNo
- Text.RE: [getMacroID] :: MacroID -> String
- Text.RE: [getZeroBasedLineNo] :: LineNo -> Int
- Text.RE: [locationCapture] :: Location -> CaptureOrdinal
- Text.RE: [locationMatch] :: Location -> Int
- Text.RE: [matchArray] :: Match a -> !(Array CaptureOrdinal (Capture a))
- Text.RE: [matchSource] :: Match a -> !a
- Text.RE: [matchesSource] :: Matches a -> !a
- Text.RE: [methodLength] :: ReplaceMethods a -> a -> Int
- Text.RE: [methodSubst] :: ReplaceMethods a -> (a -> a) -> Capture a -> a
- Text.RE: [optionsComp] :: Options_ r c e -> !c
- Text.RE: [optionsExec] :: Options_ r c e -> !e
- Text.RE: [optionsMacs] :: Options_ r c e -> !(Macros r)
- Text.RE: infixl 9 !$
- Text.RE.Capture: [allMatches] :: Matches a -> ![Match a]
- Text.RE.Capture: [captureLength] :: Capture a -> !Int
- Text.RE.Capture: [captureNames] :: Match a -> !CaptureNames
- Text.RE.Capture: [captureOffset] :: Capture a -> !Int
- Text.RE.Capture: [captureSource] :: Capture a -> !a
- Text.RE.Capture: [capturedText] :: Capture a -> !a
- Text.RE.Capture: [matchArray] :: Match a -> !(Array CaptureOrdinal (Capture a))
- Text.RE.Capture: [matchSource] :: Match a -> !a
- Text.RE.Capture: [matchesSource] :: Matches a -> !a
- Text.RE.Capture: infixl 9 !$
- Text.RE.Capture: instance (Text.Regex.Base.RegexLike.RegexContext regex source (Text.Regex.Base.RegexLike.AllTextSubmatches (GHC.Arr.Array GHC.Types.Int) (source, (GHC.Types.Int, GHC.Types.Int))), Text.Regex.Base.RegexLike.RegexLike regex source) => Text.Regex.Base.RegexLike.RegexContext regex source (Text.RE.Capture.Match source)
- Text.RE.Capture: instance (Text.Regex.Base.RegexLike.RegexContext regex source [Text.Regex.Base.RegexLike.MatchText source], Text.Regex.Base.RegexLike.RegexLike regex source) => Text.Regex.Base.RegexLike.RegexContext regex source (Text.RE.Capture.Matches source)
- Text.RE.Capture: instance GHC.Base.Functor Text.RE.Capture.Capture
- Text.RE.Capture: instance GHC.Base.Functor Text.RE.Capture.Match
- Text.RE.Capture: instance GHC.Base.Functor Text.RE.Capture.Matches
- Text.RE.Capture: instance GHC.Classes.Eq a => GHC.Classes.Eq (Text.RE.Capture.Capture a)
- Text.RE.Capture: instance GHC.Classes.Eq a => GHC.Classes.Eq (Text.RE.Capture.Match a)
- Text.RE.Capture: instance GHC.Classes.Eq a => GHC.Classes.Eq (Text.RE.Capture.Matches a)
- Text.RE.Capture: instance GHC.Show.Show a => GHC.Show.Show (Text.RE.Capture.Capture a)
- Text.RE.Capture: instance GHC.Show.Show a => GHC.Show.Show (Text.RE.Capture.Match a)
- Text.RE.Capture: instance GHC.Show.Show a => GHC.Show.Show (Text.RE.Capture.Matches a)
- Text.RE.CaptureID: [getCaptureName] :: CaptureName -> Text
- Text.RE.CaptureID: [getCaptureOrdinal] :: CaptureOrdinal -> Int
- Text.RE.CaptureID: instance Data.Hashable.Class.Hashable Text.RE.CaptureID.CaptureName
- Text.RE.CaptureID: instance GHC.Arr.Ix Text.RE.CaptureID.CaptureOrdinal
- Text.RE.CaptureID: instance GHC.Classes.Eq Text.RE.CaptureID.CaptureID
- Text.RE.CaptureID: instance GHC.Classes.Eq Text.RE.CaptureID.CaptureName
- Text.RE.CaptureID: instance GHC.Classes.Eq Text.RE.CaptureID.CaptureOrdinal
- Text.RE.CaptureID: instance GHC.Classes.Ord Text.RE.CaptureID.CaptureID
- Text.RE.CaptureID: instance GHC.Classes.Ord Text.RE.CaptureID.CaptureName
- Text.RE.CaptureID: instance GHC.Classes.Ord Text.RE.CaptureID.CaptureOrdinal
- Text.RE.CaptureID: instance GHC.Enum.Enum Text.RE.CaptureID.CaptureOrdinal
- Text.RE.CaptureID: instance GHC.Num.Num Text.RE.CaptureID.CaptureOrdinal
- Text.RE.CaptureID: instance GHC.Show.Show Text.RE.CaptureID.CaptureID
- Text.RE.CaptureID: instance GHC.Show.Show Text.RE.CaptureID.CaptureName
- Text.RE.CaptureID: instance GHC.Show.Show Text.RE.CaptureID.CaptureOrdinal
- Text.RE.Edit: instance GHC.Show.Show s => GHC.Show.Show (Text.RE.Edit.LineEdit s)
- Text.RE.Internal.NamedCaptures: instance GHC.Classes.Eq Text.RE.Internal.NamedCaptures.Token
- Text.RE.Internal.NamedCaptures: instance GHC.Generics.Generic Text.RE.Internal.NamedCaptures.Token
- Text.RE.Internal.NamedCaptures: instance GHC.Show.Show Text.RE.Internal.NamedCaptures.FormatTokenOptions
- Text.RE.Internal.NamedCaptures: instance GHC.Show.Show Text.RE.Internal.NamedCaptures.Token
- Text.RE.Internal.PreludeMacros: [_RegexSource] :: RegexSource -> String
- Text.RE.Internal.PreludeMacros: [_md_counter_samples] :: MacroDescriptor -> ![String]
- Text.RE.Internal.PreludeMacros: [_md_description] :: MacroDescriptor -> !String
- Text.RE.Internal.PreludeMacros: [_md_parser] :: MacroDescriptor -> !(Maybe FunctionID)
- Text.RE.Internal.PreludeMacros: [_md_samples] :: MacroDescriptor -> ![String]
- Text.RE.Internal.PreludeMacros: [_md_source] :: MacroDescriptor -> !RegexSource
- Text.RE.Internal.PreludeMacros: [_md_test_results] :: MacroDescriptor -> ![TestResult]
- Text.RE.Internal.PreludeMacros: instance GHC.Classes.Eq Text.RE.Internal.PreludeMacros.PreludeMacro
- Text.RE.Internal.PreludeMacros: instance GHC.Classes.Ord Text.RE.Internal.PreludeMacros.PreludeMacro
- Text.RE.Internal.PreludeMacros: instance GHC.Enum.Bounded Text.RE.Internal.PreludeMacros.PreludeMacro
- Text.RE.Internal.PreludeMacros: instance GHC.Enum.Enum Text.RE.Internal.PreludeMacros.PreludeMacro
- Text.RE.Internal.PreludeMacros: instance GHC.Show.Show Text.RE.Internal.PreludeMacros.PreludeMacro
- Text.RE.Internal.QQ: [_qqf_component] :: QQFailure -> String
- Text.RE.Internal.QQ: [_qqf_context] :: QQFailure -> String
- Text.RE.Internal.QQ: instance GHC.Exception.Exception Text.RE.Internal.QQ.QQFailure
- Text.RE.Internal.QQ: instance GHC.Show.Show Text.RE.Internal.QQ.QQFailure
- Text.RE.LineNo: [getZeroBasedLineNo] :: LineNo -> Int
- Text.RE.LineNo: instance GHC.Enum.Enum Text.RE.LineNo.LineNo
- Text.RE.LineNo: instance GHC.Show.Show Text.RE.LineNo.LineNo
- Text.RE.Options: [getMacroID] :: MacroID -> String
- Text.RE.Options: [optionsComp] :: Options_ r c e -> !c
- Text.RE.Options: [optionsExec] :: Options_ r c e -> !e
- Text.RE.Options: [optionsMacs] :: Options_ r c e -> !(Macros r)
- Text.RE.Options: instance (GHC.Show.Show e, GHC.Show.Show c, GHC.Show.Show r) => GHC.Show.Show (Text.RE.Options.Options_ r c e)
- Text.RE.Options: instance Data.Hashable.Class.Hashable Text.RE.Options.MacroID
- Text.RE.Options: instance Data.String.IsString Text.RE.Options.MacroID
- Text.RE.Options: instance GHC.Classes.Eq Text.RE.Options.MacroID
- Text.RE.Options: instance GHC.Classes.Eq Text.RE.Options.SimpleRegexOptions
- Text.RE.Options: instance GHC.Classes.Ord Text.RE.Options.MacroID
- Text.RE.Options: instance GHC.Classes.Ord Text.RE.Options.SimpleRegexOptions
- Text.RE.Options: instance GHC.Enum.Bounded Text.RE.Options.SimpleRegexOptions
- Text.RE.Options: instance GHC.Enum.Enum Text.RE.Options.SimpleRegexOptions
- Text.RE.Options: instance GHC.Show.Show Text.RE.Options.MacroID
- Text.RE.Options: instance GHC.Show.Show Text.RE.Options.SimpleRegexOptions
- Text.RE.Options: instance Language.Haskell.TH.Syntax.Lift Text.RE.Options.SimpleRegexOptions
- Text.RE.PCRE: (*=~) :: IsRegex RE s => s -> RE -> Matches s
- Text.RE.PCRE: (=~) :: (RegexContext Regex s a, RegexMaker Regex CompOption ExecOption s) => s -> RE -> a
- Text.RE.PCRE: (=~~) :: (Monad m, RegexContext Regex s a, RegexMaker Regex CompOption ExecOption s) => s -> RE -> m a
- Text.RE.PCRE: (?=~) :: IsRegex RE s => s -> RE -> Match s
- Text.RE.PCRE.ByteString: (*=~) :: ByteString -> RE -> Matches ByteString
- Text.RE.PCRE.ByteString: (=~) :: (Typeable a, RegexContext Regex ByteString a, RegexMaker Regex CompOption ExecOption String) => 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: (?=~) :: ByteString -> RE -> Match ByteString
- Text.RE.PCRE.ByteString: instance Text.RE.IsRegex.IsRegex Text.RE.PCRE.RE.RE Data.ByteString.Internal.ByteString
- Text.RE.PCRE.ByteString.Lazy: (*=~) :: ByteString -> RE -> Matches ByteString
- Text.RE.PCRE.ByteString.Lazy: (=~) :: (Typeable a, RegexContext Regex ByteString a, RegexMaker Regex CompOption ExecOption String) => 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: (?=~) :: ByteString -> RE -> Match ByteString
- Text.RE.PCRE.ByteString.Lazy: instance Text.RE.IsRegex.IsRegex Text.RE.PCRE.RE.RE Data.ByteString.Lazy.Internal.ByteString
- Text.RE.PCRE.RE: compileRegex :: (IsOption o RE CompOption ExecOption, Functor m, Monad m) => o -> String -> m RE
- Text.RE.PCRE.RE: cp :: QuasiQuoter
- Text.RE.PCRE.RE: data RE
- Text.RE.PCRE.RE: defaultOptions :: Options
- Text.RE.PCRE.RE: escape :: (String -> String) -> String -> RE
- Text.RE.PCRE.RE: escapeREString :: String -> String
- Text.RE.PCRE.RE: instance Text.RE.Options.IsOption () Text.RE.PCRE.RE.RE Text.Regex.PCRE.Wrap.CompOption Text.Regex.PCRE.Wrap.ExecOption
- Text.RE.PCRE.RE: instance Text.RE.Options.IsOption (Text.RE.Options.Macros Text.RE.PCRE.RE.RE) Text.RE.PCRE.RE.RE Text.Regex.PCRE.Wrap.CompOption Text.Regex.PCRE.Wrap.ExecOption
- Text.RE.PCRE.RE: instance Text.RE.Options.IsOption Text.RE.Options.SimpleRegexOptions Text.RE.PCRE.RE.RE Text.Regex.PCRE.Wrap.CompOption Text.Regex.PCRE.Wrap.ExecOption
- Text.RE.PCRE.RE: instance Text.RE.Options.IsOption Text.RE.PCRE.RE.Options Text.RE.PCRE.RE.RE Text.Regex.PCRE.Wrap.CompOption Text.Regex.PCRE.Wrap.ExecOption
- Text.RE.PCRE.RE: instance Text.RE.Options.IsOption Text.Regex.PCRE.Wrap.CompOption Text.RE.PCRE.RE.RE Text.Regex.PCRE.Wrap.CompOption Text.Regex.PCRE.Wrap.ExecOption
- Text.RE.PCRE.RE: instance Text.RE.Options.IsOption Text.Regex.PCRE.Wrap.ExecOption Text.RE.PCRE.RE.RE Text.Regex.PCRE.Wrap.CompOption Text.Regex.PCRE.Wrap.ExecOption
- Text.RE.PCRE.RE: noPreludeOptions :: Options
- Text.RE.PCRE.RE: prelude :: Macros RE
- Text.RE.PCRE.RE: preludeEnv :: MacroEnv
- Text.RE.PCRE.RE: preludeSource :: PreludeMacro -> String
- Text.RE.PCRE.RE: preludeSources :: String
- Text.RE.PCRE.RE: preludeSummary :: PreludeMacro -> String
- Text.RE.PCRE.RE: preludeTable :: String
- Text.RE.PCRE.RE: preludeTestsFailing :: [MacroID]
- Text.RE.PCRE.RE: re :: QuasiQuoter
- Text.RE.PCRE.RE: reBI :: QuasiQuoter
- Text.RE.PCRE.RE: reBS :: QuasiQuoter
- Text.RE.PCRE.RE: reBlockInsensitive :: QuasiQuoter
- Text.RE.PCRE.RE: reBlockSensitive :: QuasiQuoter
- Text.RE.PCRE.RE: reCaptureNames :: RE -> CaptureNames
- Text.RE.PCRE.RE: reMI :: QuasiQuoter
- Text.RE.PCRE.RE: reMS :: QuasiQuoter
- Text.RE.PCRE.RE: reMultilineInsensitive :: QuasiQuoter
- Text.RE.PCRE.RE: reMultilineSensitive :: QuasiQuoter
- Text.RE.PCRE.RE: reOptions :: RE -> Options
- Text.RE.PCRE.RE: reRegex :: RE -> Regex
- Text.RE.PCRE.RE: reSource :: RE -> String
- Text.RE.PCRE.RE: re_ :: QuasiQuoter
- Text.RE.PCRE.RE: regexType :: RegexType
- Text.RE.PCRE.RE: type Options = Options_ RE CompOption ExecOption
- Text.RE.PCRE.RE: unpackSimpleRegexOptions :: SimpleRegexOptions -> Options
- Text.RE.PCRE.Sequence: (*=~) :: (Seq Char) -> RE -> Matches (Seq Char)
- Text.RE.PCRE.Sequence: (=~) :: (Typeable a, RegexContext Regex (Seq Char) a, RegexMaker Regex CompOption ExecOption String) => (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: (?=~) :: (Seq Char) -> RE -> Match (Seq Char)
- Text.RE.PCRE.Sequence: instance Text.RE.IsRegex.IsRegex Text.RE.PCRE.RE.RE (Data.Sequence.Seq GHC.Types.Char)
- Text.RE.PCRE.String: (*=~) :: String -> RE -> Matches String
- Text.RE.PCRE.String: (=~) :: (Typeable a, RegexContext Regex String a, RegexMaker Regex CompOption ExecOption String) => 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: (?=~) :: String -> RE -> Match String
- Text.RE.PCRE.String: instance Text.RE.IsRegex.IsRegex Text.RE.PCRE.RE.RE GHC.Base.String
- Text.RE.Parsers: instance GHC.Classes.Eq Text.RE.Parsers.Severity
- Text.RE.Parsers: instance GHC.Classes.Ord Text.RE.Parsers.Severity
- Text.RE.Parsers: instance GHC.Enum.Bounded Text.RE.Parsers.Severity
- Text.RE.Parsers: instance GHC.Enum.Enum Text.RE.Parsers.Severity
- Text.RE.Parsers: instance GHC.Show.Show Text.RE.Parsers.Severity
- Text.RE.Replace: [locationCapture] :: Location -> CaptureOrdinal
- Text.RE.Replace: [locationMatch] :: Location -> Int
- Text.RE.Replace: [methodLength] :: ReplaceMethods a -> a -> Int
- Text.RE.Replace: [methodSubst] :: ReplaceMethods a -> (a -> a) -> Capture a -> a
- Text.RE.Replace: instance GHC.Show.Show Text.RE.Replace.Context
- Text.RE.Replace: instance GHC.Show.Show Text.RE.Replace.Location
- Text.RE.Replace: instance Text.RE.Replace.Replace (Data.Sequence.Seq GHC.Types.Char)
- Text.RE.Replace: instance Text.RE.Replace.Replace Data.ByteString.Internal.ByteString
- Text.RE.Replace: instance Text.RE.Replace.Replace Data.ByteString.Lazy.Internal.ByteString
- Text.RE.Replace: instance Text.RE.Replace.Replace Data.Text.Internal.Lazy.Text
- Text.RE.Replace: instance Text.RE.Replace.Replace Data.Text.Internal.Text
- Text.RE.Replace: instance Text.RE.Replace.Replace [GHC.Types.Char]
- Text.RE.TDFA.ByteString: instance Text.RE.IsRegex.IsRegex Text.RE.TDFA.RE.RE Data.ByteString.Internal.ByteString
- Text.RE.TDFA.ByteString.Lazy: instance Text.RE.IsRegex.IsRegex Text.RE.TDFA.RE.RE Data.ByteString.Lazy.Internal.ByteString
- Text.RE.TDFA.RE: instance Text.RE.Options.IsOption () Text.RE.TDFA.RE.RE Text.Regex.TDFA.Common.CompOption Text.Regex.TDFA.Common.ExecOption
- Text.RE.TDFA.RE: instance Text.RE.Options.IsOption (Text.RE.Options.Macros Text.RE.TDFA.RE.RE) Text.RE.TDFA.RE.RE Text.Regex.TDFA.Common.CompOption Text.Regex.TDFA.Common.ExecOption
- Text.RE.TDFA.RE: instance Text.RE.Options.IsOption Text.RE.Options.SimpleRegexOptions Text.RE.TDFA.RE.RE Text.Regex.TDFA.Common.CompOption Text.Regex.TDFA.Common.ExecOption
- Text.RE.TDFA.RE: instance Text.RE.Options.IsOption Text.RE.TDFA.RE.Options Text.RE.TDFA.RE.RE Text.Regex.TDFA.Common.CompOption Text.Regex.TDFA.Common.ExecOption
- Text.RE.TDFA.RE: instance Text.RE.Options.IsOption Text.Regex.TDFA.Common.CompOption Text.RE.TDFA.RE.RE Text.Regex.TDFA.Common.CompOption Text.Regex.TDFA.Common.ExecOption
- Text.RE.TDFA.RE: instance Text.RE.Options.IsOption Text.Regex.TDFA.Common.ExecOption Text.RE.TDFA.RE.RE Text.Regex.TDFA.Common.CompOption Text.Regex.TDFA.Common.ExecOption
- Text.RE.TDFA.Sequence: instance Text.RE.IsRegex.IsRegex Text.RE.TDFA.RE.RE (Data.Sequence.Seq GHC.Types.Char)
- Text.RE.TDFA.String: instance Text.RE.IsRegex.IsRegex Text.RE.TDFA.RE.RE GHC.Base.String
- Text.RE.TDFA.Text: instance Text.RE.IsRegex.IsRegex Text.RE.TDFA.RE.RE Data.Text.Internal.Text
- Text.RE.TDFA.Text.Lazy: instance Text.RE.IsRegex.IsRegex Text.RE.TDFA.RE.RE Data.Text.Internal.Lazy.Text
- Text.RE.TestBench: [_FunctionID] :: FunctionID -> String
- Text.RE.TestBench: [_RegexSource] :: RegexSource -> String
- Text.RE.TestBench: [_TestResult] :: TestResult -> String
- Text.RE.TestBench: [_md_counter_samples] :: MacroDescriptor -> ![String]
- Text.RE.TestBench: [_md_description] :: MacroDescriptor -> !String
- Text.RE.TestBench: [_md_parser] :: MacroDescriptor -> !(Maybe FunctionID)
- Text.RE.TestBench: [_md_samples] :: MacroDescriptor -> ![String]
- Text.RE.TestBench: [_md_source] :: MacroDescriptor -> !RegexSource
- Text.RE.TestBench: [_md_test_results] :: MacroDescriptor -> ![TestResult]
- Text.RE.TestBench: [getMacroID] :: MacroID -> String
- Text.RE.TestBench: instance Data.String.IsString Text.RE.TestBench.FunctionID
- Text.RE.TestBench: instance Data.String.IsString Text.RE.TestBench.RegexSource
- Text.RE.TestBench: instance Data.String.IsString Text.RE.TestBench.TestResult
- Text.RE.TestBench: instance GHC.Arr.Ix Text.RE.TestBench.Col
- Text.RE.TestBench: instance GHC.Classes.Eq Text.RE.TestBench.Col
- Text.RE.TestBench: instance GHC.Classes.Eq Text.RE.TestBench.RegexType
- Text.RE.TestBench: instance GHC.Classes.Eq Text.RE.TestBench.WithCaptures
- Text.RE.TestBench: instance GHC.Classes.Ord Text.RE.TestBench.Col
- Text.RE.TestBench: instance GHC.Classes.Ord Text.RE.TestBench.RegexType
- Text.RE.TestBench: instance GHC.Classes.Ord Text.RE.TestBench.WithCaptures
- Text.RE.TestBench: instance GHC.Enum.Bounded Text.RE.TestBench.Col
- Text.RE.TestBench: instance GHC.Enum.Bounded Text.RE.TestBench.RegexType
- Text.RE.TestBench: instance GHC.Enum.Enum Text.RE.TestBench.Col
- Text.RE.TestBench: instance GHC.Enum.Enum Text.RE.TestBench.RegexType
- Text.RE.TestBench: instance GHC.Show.Show Text.RE.TestBench.Col
- Text.RE.TestBench: instance GHC.Show.Show Text.RE.TestBench.FunctionID
- Text.RE.TestBench: instance GHC.Show.Show Text.RE.TestBench.MacroDescriptor
- Text.RE.TestBench: instance GHC.Show.Show Text.RE.TestBench.REToken
- Text.RE.TestBench: instance GHC.Show.Show Text.RE.TestBench.RegexSource
- Text.RE.TestBench: instance GHC.Show.Show Text.RE.TestBench.RegexType
- Text.RE.TestBench: instance GHC.Show.Show Text.RE.TestBench.TestResult
- Text.RE.TestBench: instance GHC.Show.Show Text.RE.TestBench.WithCaptures
- Text.RE.Tools.Grep: [getLineMatches] :: Line -> Matches ByteString
- Text.RE.Tools.Grep: [getLineNumber] :: Line -> LineNo
- Text.RE.Tools.Grep: instance GHC.Show.Show Text.RE.Tools.Grep.Line
+ Text.RE: allMatches :: Matches a -> ![Match a]
+ Text.RE: captureLength :: Capture a -> !Int
+ Text.RE: captureNames :: Match a -> !CaptureNames
+ Text.RE: captureOffset :: Capture a -> !Int
+ Text.RE: captureSource :: Capture a -> !a
+ Text.RE: capturedText :: Capture a -> !a
+ Text.RE: getCaptureName :: CaptureName -> Text
+ Text.RE: getCaptureOrdinal :: CaptureOrdinal -> Int
+ Text.RE: getLineMatches :: Line -> Matches ByteString
+ Text.RE: getLineNumber :: Line -> LineNo
+ Text.RE: getMacroID :: MacroID -> String
+ Text.RE: getZeroBasedLineNo :: LineNo -> Int
+ Text.RE: locationCapture :: Location -> CaptureOrdinal
+ Text.RE: locationMatch :: Location -> Int
+ Text.RE: matchArray :: Match a -> !(Array CaptureOrdinal (Capture a))
+ Text.RE: matchSource :: Match a -> !a
+ Text.RE: matchesSource :: Matches a -> !a
+ Text.RE: methodLength :: ReplaceMethods a -> a -> Int
+ Text.RE: methodSubst :: ReplaceMethods a -> (a -> a) -> Capture a -> a
+ Text.RE: optionsComp :: Options_ r c e -> !c
+ Text.RE: optionsExec :: Options_ r c e -> !e
+ Text.RE: optionsMacs :: Options_ r c e -> !(Macros r)
+ Text.RE.Capture: allMatches :: Matches a -> ![Match a]
+ Text.RE.Capture: captureLength :: Capture a -> !Int
+ Text.RE.Capture: captureNames :: Match a -> !CaptureNames
+ Text.RE.Capture: captureOffset :: Capture a -> !Int
+ Text.RE.Capture: captureSource :: Capture a -> !a
+ Text.RE.Capture: capturedText :: Capture a -> !a
+ Text.RE.Capture: instance (RegexContext regex source (AllTextSubmatches (Array Int) (source, (Int, Int))), RegexLike regex source) => RegexContext regex source (Match source)
+ Text.RE.Capture: instance (RegexContext regex source [MatchText source], RegexLike regex source) => RegexContext regex source (Matches source)
+ Text.RE.Capture: instance Eq a => Eq (Capture a)
+ Text.RE.Capture: instance Eq a => Eq (Match a)
+ Text.RE.Capture: instance Eq a => Eq (Matches a)
+ Text.RE.Capture: instance Functor Capture
+ Text.RE.Capture: instance Functor Match
+ Text.RE.Capture: instance Functor Matches
+ Text.RE.Capture: instance Show a => Show (Capture a)
+ Text.RE.Capture: instance Show a => Show (Match a)
+ Text.RE.Capture: instance Show a => Show (Matches a)
+ Text.RE.Capture: instance Typeable Match
+ Text.RE.Capture: instance Typeable Matches
+ Text.RE.Capture: matchArray :: Match a -> !(Array CaptureOrdinal (Capture a))
+ Text.RE.Capture: matchSource :: Match a -> !a
+ Text.RE.Capture: matchesSource :: Matches a -> !a
+ Text.RE.CaptureID: getCaptureName :: CaptureName -> Text
+ Text.RE.CaptureID: getCaptureOrdinal :: CaptureOrdinal -> Int
+ Text.RE.CaptureID: instance Enum CaptureOrdinal
+ Text.RE.CaptureID: instance Eq CaptureID
+ Text.RE.CaptureID: instance Eq CaptureName
+ Text.RE.CaptureID: instance Eq CaptureOrdinal
+ Text.RE.CaptureID: instance Hashable CaptureName
+ Text.RE.CaptureID: instance Ix CaptureOrdinal
+ Text.RE.CaptureID: instance Num CaptureOrdinal
+ Text.RE.CaptureID: instance Ord CaptureID
+ Text.RE.CaptureID: instance Ord CaptureName
+ Text.RE.CaptureID: instance Ord CaptureOrdinal
+ Text.RE.CaptureID: instance Show CaptureID
+ Text.RE.CaptureID: instance Show CaptureName
+ Text.RE.CaptureID: instance Show CaptureOrdinal
+ Text.RE.Edit: instance Show s => Show (LineEdit s)
+ Text.RE.Internal.NamedCaptures: instance Constructor C1_0Token
+ Text.RE.Internal.NamedCaptures: instance Constructor C1_1Token
+ Text.RE.Internal.NamedCaptures: instance Constructor C1_2Token
+ Text.RE.Internal.NamedCaptures: instance Constructor C1_3Token
+ Text.RE.Internal.NamedCaptures: instance Constructor C1_4Token
+ Text.RE.Internal.NamedCaptures: instance Constructor C1_5Token
+ Text.RE.Internal.NamedCaptures: instance Datatype D1Token
+ Text.RE.Internal.NamedCaptures: instance Eq Token
+ Text.RE.Internal.NamedCaptures: instance Generic Token
+ Text.RE.Internal.NamedCaptures: instance Show FormatTokenOptions
+ Text.RE.Internal.NamedCaptures: instance Show Token
+ Text.RE.Internal.PreludeMacros: _RegexSource :: RegexSource -> String
+ Text.RE.Internal.PreludeMacros: _md_counter_samples :: MacroDescriptor -> ![String]
+ Text.RE.Internal.PreludeMacros: _md_description :: MacroDescriptor -> !String
+ Text.RE.Internal.PreludeMacros: _md_parser :: MacroDescriptor -> !(Maybe FunctionID)
+ Text.RE.Internal.PreludeMacros: _md_samples :: MacroDescriptor -> ![String]
+ Text.RE.Internal.PreludeMacros: _md_source :: MacroDescriptor -> !RegexSource
+ Text.RE.Internal.PreludeMacros: _md_test_results :: MacroDescriptor -> ![TestResult]
+ Text.RE.Internal.PreludeMacros: instance Bounded PreludeMacro
+ Text.RE.Internal.PreludeMacros: instance Enum PreludeMacro
+ Text.RE.Internal.PreludeMacros: instance Eq PreludeMacro
+ Text.RE.Internal.PreludeMacros: instance Ord PreludeMacro
+ Text.RE.Internal.PreludeMacros: instance Show PreludeMacro
+ Text.RE.Internal.QQ: _qqf_component :: QQFailure -> String
+ Text.RE.Internal.QQ: _qqf_context :: QQFailure -> String
+ Text.RE.Internal.QQ: instance Exception QQFailure
+ Text.RE.Internal.QQ: instance Show QQFailure
+ Text.RE.Internal.QQ: instance Typeable QQFailure
+ Text.RE.LineNo: getZeroBasedLineNo :: LineNo -> Int
+ Text.RE.LineNo: instance Enum LineNo
+ Text.RE.LineNo: instance Show LineNo
+ Text.RE.Options: getMacroID :: MacroID -> String
+ Text.RE.Options: instance (Show r, Show c, Show e) => Show (Options_ r c e)
+ Text.RE.Options: instance Bounded SimpleRegexOptions
+ Text.RE.Options: instance Enum SimpleRegexOptions
+ Text.RE.Options: instance Eq MacroID
+ Text.RE.Options: instance Eq SimpleRegexOptions
+ Text.RE.Options: instance Hashable MacroID
+ Text.RE.Options: instance IsString MacroID
+ Text.RE.Options: instance Lift SimpleRegexOptions
+ Text.RE.Options: instance Ord MacroID
+ Text.RE.Options: instance Ord SimpleRegexOptions
+ Text.RE.Options: instance Show MacroID
+ Text.RE.Options: instance Show SimpleRegexOptions
+ Text.RE.Options: optionsComp :: Options_ r c e -> !c
+ Text.RE.Options: optionsExec :: Options_ r c e -> !e
+ Text.RE.Options: optionsMacs :: Options_ r c e -> !(Macros r)
+ Text.RE.Parsers: instance Bounded Severity
+ Text.RE.Parsers: instance Enum Severity
+ Text.RE.Parsers: instance Eq Severity
+ Text.RE.Parsers: instance Ord Severity
+ Text.RE.Parsers: instance Show Severity
+ Text.RE.Replace: instance Replace (Seq Char)
+ Text.RE.Replace: instance Replace ByteString
+ Text.RE.Replace: instance Replace Text
+ Text.RE.Replace: instance Replace [Char]
+ Text.RE.Replace: instance Show Context
+ Text.RE.Replace: instance Show Location
+ Text.RE.Replace: locationCapture :: Location -> CaptureOrdinal
+ Text.RE.Replace: locationMatch :: Location -> Int
+ Text.RE.Replace: methodLength :: ReplaceMethods a -> a -> Int
+ Text.RE.Replace: methodSubst :: ReplaceMethods a -> (a -> a) -> Capture a -> a
+ Text.RE.TDFA.ByteString: instance IsRegex RE ByteString
+ Text.RE.TDFA.ByteString.Lazy: instance IsRegex RE ByteString
+ Text.RE.TDFA.RE: instance IsOption () RE CompOption ExecOption
+ Text.RE.TDFA.RE: instance IsOption (Macros RE) RE CompOption ExecOption
+ Text.RE.TDFA.RE: instance IsOption CompOption RE CompOption ExecOption
+ Text.RE.TDFA.RE: instance IsOption ExecOption RE CompOption ExecOption
+ Text.RE.TDFA.RE: instance IsOption Options RE CompOption ExecOption
+ Text.RE.TDFA.RE: instance IsOption SimpleRegexOptions RE CompOption ExecOption
+ Text.RE.TDFA.Sequence: instance IsRegex RE (Seq Char)
+ Text.RE.TDFA.String: instance IsRegex RE String
+ Text.RE.TDFA.Text: instance IsRegex RE Text
+ Text.RE.TDFA.Text.Lazy: instance IsRegex RE Text
+ Text.RE.TestBench: _FunctionID :: FunctionID -> String
+ Text.RE.TestBench: _RegexSource :: RegexSource -> String
+ Text.RE.TestBench: _TestResult :: TestResult -> String
+ Text.RE.TestBench: _md_counter_samples :: MacroDescriptor -> ![String]
+ Text.RE.TestBench: _md_description :: MacroDescriptor -> !String
+ Text.RE.TestBench: _md_parser :: MacroDescriptor -> !(Maybe FunctionID)
+ Text.RE.TestBench: _md_samples :: MacroDescriptor -> ![String]
+ Text.RE.TestBench: _md_source :: MacroDescriptor -> !RegexSource
+ Text.RE.TestBench: _md_test_results :: MacroDescriptor -> ![TestResult]
+ Text.RE.TestBench: getMacroID :: MacroID -> String
+ Text.RE.TestBench: instance Bounded Col
+ Text.RE.TestBench: instance Enum Col
+ Text.RE.TestBench: instance Eq Col
+ Text.RE.TestBench: instance Eq WithCaptures
+ Text.RE.TestBench: instance IsString FunctionID
+ Text.RE.TestBench: instance IsString RegexSource
+ Text.RE.TestBench: instance IsString TestResult
+ Text.RE.TestBench: instance Ix Col
+ Text.RE.TestBench: instance Ord Col
+ Text.RE.TestBench: instance Ord WithCaptures
+ Text.RE.TestBench: instance Show Col
+ Text.RE.TestBench: instance Show FunctionID
+ Text.RE.TestBench: instance Show MacroDescriptor
+ Text.RE.TestBench: instance Show REToken
+ Text.RE.TestBench: instance Show RegexSource
+ Text.RE.TestBench: instance Show RegexType
+ Text.RE.TestBench: instance Show TestResult
+ Text.RE.TestBench: instance Show WithCaptures
+ Text.RE.TestBench: isPCRE :: RegexType -> Bool
+ Text.RE.TestBench: isTDFA :: RegexType -> Bool
+ Text.RE.TestBench: mdRegexSource :: RegexType -> WithCaptures -> MacroEnv -> MacroDescriptor -> String
+ Text.RE.TestBench: presentRegexType :: RegexType -> String
+ Text.RE.Tools.Grep: getLineMatches :: Line -> Matches ByteString
+ Text.RE.Tools.Grep: getLineNumber :: Line -> LineNo
+ Text.RE.Tools.Grep: instance Show Line
- Text.RE: class (Extract a, Monoid a) => Replace a where textifyE = pack . unpackE detextifyE = packE . unpack appendNewlineE = (<> packE "\n") substE f m@(Capture {..}) = capturePrefix m <> f capturedText <> captureSuffix m
+ Text.RE: class (Extract a, Monoid a) => Replace a where textifyE = pack . unpackE detextifyE = packE . unpack appendNewlineE = (<> packE "") substE f m@(Capture {..}) = capturePrefix m <> f capturedText <> captureSuffix m
- Text.RE.Internal.PreludeMacros: PCRE :: RegexType
+ Text.RE.Internal.PreludeMacros: PCRE :: TestBenchMatcher -> RegexType
- Text.RE.Internal.PreludeMacros: TDFA :: RegexType
+ Text.RE.Internal.PreludeMacros: TDFA :: TestBenchMatcher -> RegexType
- Text.RE.Replace: class (Extract a, Monoid a) => Replace a where textifyE = pack . unpackE detextifyE = packE . unpack appendNewlineE = (<> packE "\n") substE f m@(Capture {..}) = capturePrefix m <> f capturedText <> captureSuffix m
+ Text.RE.Replace: class (Extract a, Monoid a) => Replace a where textifyE = pack . unpackE detextifyE = packE . unpack appendNewlineE = (<> packE "") substE f m@(Capture {..}) = capturePrefix m <> f capturedText <> captureSuffix m
- Text.RE.TestBench: PCRE :: RegexType
+ Text.RE.TestBench: PCRE :: TestBenchMatcher -> RegexType
- Text.RE.TestBench: TDFA :: RegexType
+ Text.RE.TestBench: TDFA :: TestBenchMatcher -> RegexType

Files

README.markdown view
@@ -51,6 +51,8 @@  &nbsp;&nbsp;&nbsp;&nbsp;&#x2612;&nbsp;&nbsp;2017-03-05  v0.5.0.0  [Ready for review: API, tutorials and examples finalized](https://github.com/iconnect/regex/milestone/6) +&nbsp;&nbsp;&nbsp;&nbsp;&#x2612;&nbsp;&nbsp;2017-13-05  v0.6.0.0  [Split out PCRE](https://github.com/iconnect/regex/milestone/7)+ &nbsp;&nbsp;&nbsp;&nbsp;&#x2610;&nbsp;&nbsp;2017-03-20  v1.0.0.0  [First stable release](https://github.com/iconnect/regex/milestone/3)  &nbsp;&nbsp;&nbsp;&nbsp;&#x2610;&nbsp;&nbsp;2017-08-31  v2.0.0.0  [Fast text replacement with benchmarks](https://github.com/iconnect/regex/milestone/4)
Text/RE/Internal/NamedCaptures.lhs view
@@ -26,12 +26,13 @@ import           Text.RE import           Text.RE.Internal.PreludeMacros import           Text.RE.Internal.QQ-import           Text.Regex.PCRE+import           Text.RE.TestBench+import           Text.Regex.TDFA   cp :: QuasiQuoter cp =-    (qq0 "re_")+    (qq0 "cp")       { quoteExp = parse_capture       } @@ -158,9 +159,9 @@ idFormatTokenOptions :: FormatTokenOptions idFormatTokenOptions =   FormatTokenOptions-    { _fto_regex_type     = Nothing-    , _fto_min_caps       = False-    , _fto_incl_caps = True+    { _fto_regex_type = Nothing+    , _fto_min_caps   = False+    , _fto_incl_caps  = True     }  formatTokens' :: FormatTokenOptions -> [Token] -> String@@ -170,7 +171,7 @@       where         t_s = case tk of           ECap  mb -> ecap mb-          PGrp     -> if _fto_regex_type == Just TDFA then "(" else "(?:"+          PGrp     -> if maybe False isTDFA _fto_regex_type then "(" else "(?:"           PCap     -> "(?"           Bra      -> bra _fto_min_caps           BS    c  -> "\\" ++ [c]@@ -182,7 +183,7 @@         Just nm -> "${"++nm++"}("       False -> bra _fto_min_caps -    bra mc  = case mc && _fto_regex_type == Just PCRE of+    bra mc  = case mc && maybe False isPCRE _fto_regex_type of       True  -> "(?:"       False -> "(" \end{code}
Text/RE/Internal/PreludeMacros.hs view
@@ -58,14 +58,7 @@   formatMacroSource rty ExclCaptures (preludeMacroEnv rty) . prelude_macro_id  preludeMacroEnv :: RegexType -> MacroEnv-preludeMacroEnv TDFA = prelude_macro_env_tdfa-preludeMacroEnv PCRE = prelude_macro_env_pcre--prelude_macro_env_pcre :: MacroEnv-prelude_macro_env_pcre = fix $ prelude_macro_env PCRE--prelude_macro_env_tdfa :: MacroEnv-prelude_macro_env_tdfa = fix $ prelude_macro_env TDFA+preludeMacroEnv rty = fix $ prelude_macro_env rty  prelude_macro_env :: RegexType -> MacroEnv -> MacroEnv prelude_macro_env rty env = HML.fromList $ catMaybes@@ -273,8 +266,8 @@              -> MacroEnv              -> PreludeMacro              -> Maybe MacroDescriptor-string_macro     PCRE _  _   = Nothing-string_macro rty@TDFA env pm =+string_macro     (PCRE _) _  _   = Nothing+string_macro rty@(TDFA _) env pm =   Just $ run_tests rty (fmap T.unpack . parseString) samples env pm     MacroDescriptor       { _md_source          = "\"(?:[^\"\\]+|\\\\[\\\"])*\""@@ -796,8 +789,8 @@         ]      re = case rty of-      PCRE -> re_pcre-      TDFA -> re_tdfa+      PCRE _ -> re_pcre+      TDFA _ -> re_tdfa      re_tdfa = bracketedRegexSource $           intercalate "|" $
− Text/RE/PCRE.hs
@@ -1,96 +0,0 @@-{-# LANGUAGE FlexibleContexts           #-}-{-# LANGUAGE CPP                        #-}-#if __GLASGOW_HASKELL__ >= 800-{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}-#endif-{-# OPTIONS_GHC -fno-warn-dodgy-exports #-}--module Text.RE.PCRE-  (-  -- * Tutorial-  -- $tutorial--  -- * The Overloaded Match Operators-    (*=~)-  , (?=~)-  , (=~)-  , (=~~)-  -- * The Toolkit-  -- $toolkit-  , module Text.RE-  -- * The 'RE' Type-  -- $re-  , module Text.RE.PCRE.RE-  -- * The Operator 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 qualified Text.Regex.Base                          as B-import           Text.RE-import           Text.RE.Internal.AddCaptureNames-import           Text.RE.PCRE.RE-import qualified Text.Regex.PCRE                          as PCRE-import           Text.RE.PCRE.ByteString()-import           Text.RE.PCRE.ByteString.Lazy()-import           Text.RE.PCRE.Sequence()-import           Text.RE.PCRE.String()----- | find all matches in text-(*=~) :: IsRegex RE s-      => s-      -> RE-      -> Matches s-(*=~) bs rex = addCaptureNamesToMatches (reCaptureNames rex) $ matchMany rex bs---- | find first match in text-(?=~) :: IsRegex RE s-      => s-      -> RE-      -> Match s-(?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ matchOnce rex bs---- | the regex-base polymorphic match operator-(=~) :: ( B.RegexContext PCRE.Regex s a-        , B.RegexMaker   PCRE.Regex PCRE.CompOption PCRE.ExecOption s-        )-     => s-     -> RE-     -> a-(=~) bs rex = B.match (reRegex rex) bs---- | the regex-base monadic, polymorphic match operator-(=~~) :: ( Monad m-         , B.RegexContext PCRE.Regex s a-         , B.RegexMaker   PCRE.Regex PCRE.CompOption PCRE.ExecOption s-         )-      => s-      -> RE-      -> m a-(=~~) bs rex = B.matchM (reRegex rex) bs---- $tutorial--- We have a regex tutorial at <http://tutorial.regex.uk>. These API--- docs are mainly for reference.---- $toolkit------ Beyond the above match operators and the regular expression type--- below, "Text.RE" contains the toolkit for replacing captures,--- specifying options, etc.---- $re------ "Text.RE.TDFA.RE" contains the toolkit specific to the 'RE' type,--- the type generated by the gegex compiler.---- $instances------ These modules merely provide the instances for the above regex--- match operators at the various text types.
− Text/RE/PCRE/ByteString.hs
@@ -1,91 +0,0 @@-{-# LANGUAGE NoImplicitPrelude          #-}-{-# LANGUAGE MultiParamTypeClasses      #-}-{-# LANGUAGE FlexibleContexts           #-}-{-# LANGUAGE FlexibleInstances          #-}-{-# OPTIONS_GHC -fno-warn-orphans       #-}-{-# LANGUAGE CPP                        #-}-#if __GLASGOW_HASKELL__ >= 800-{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}-#endif--module Text.RE.PCRE.ByteString-  (-  -- * Tutorial-  -- $tutorial--  -- * The Match Operators-    (*=~)-  , (?=~)-  , (=~)-  , (=~~)-  -- * The Toolkit-  -- $toolkit-  , module Text.RE-  -- * The 'RE' Type-  -- $re-  , module Text.RE.PCRE.RE-  ) where--import           Prelude.Compat-import qualified Data.ByteString               as B-import           Data.Typeable-import           Text.Regex.Base-import           Text.RE-import           Text.RE.Internal.AddCaptureNames-import           Text.RE.PCRE.RE-import qualified Text.Regex.PCRE               as PCRE----- | find all matches in text-(*=~) :: B.ByteString-      -> RE-      -> Matches B.ByteString-(*=~) bs rex = addCaptureNamesToMatches (reCaptureNames rex) $ match (reRegex rex) bs---- | find first match in text-(?=~) :: B.ByteString-      -> RE-      -> Match B.ByteString-(?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs---- | 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-(=~~) :: ( Monad m-         , Functor m-         , Typeable a-         , RegexContext PCRE.Regex B.ByteString a-         , RegexMaker   PCRE.Regex PCRE.CompOption PCRE.ExecOption String-         )-      => B.ByteString-      -> RE-      -> m a-(=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs--instance IsRegex RE B.ByteString where-  matchOnce   = flip (?=~)-  matchMany   = flip (*=~)-  regexSource = reSource---- $tutorial--- We have a regex tutorial at <http://tutorial.regex.uk>. These API--- docs are mainly for reference.---- $toolkit------ Beyond the above match operators and the regular expression type--- below, "Text.RE" contains the toolkit for replacing captures,--- specifying options, etc.---- $re------ "Text.RE.PCRE.RE" contains the toolkit specific to the 'RE' type,--- the type generated by the gegex compiler.
− Text/RE/PCRE/ByteString/Lazy.hs
@@ -1,91 +0,0 @@-{-# LANGUAGE NoImplicitPrelude          #-}-{-# LANGUAGE MultiParamTypeClasses      #-}-{-# LANGUAGE FlexibleContexts           #-}-{-# LANGUAGE FlexibleInstances          #-}-{-# OPTIONS_GHC -fno-warn-orphans       #-}-{-# LANGUAGE CPP                        #-}-#if __GLASGOW_HASKELL__ >= 800-{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}-#endif--module Text.RE.PCRE.ByteString.Lazy-  (-  -- * Tutorial-  -- $tutorial--  -- * The Match Operators-    (*=~)-  , (?=~)-  , (=~)-  , (=~~)-  -- * The Toolkit-  -- $toolkit-  , module Text.RE-  -- * The 'RE' Type-  -- $re-  , module Text.RE.PCRE.RE-  ) where--import           Prelude.Compat-import qualified Data.ByteString.Lazy          as LBS-import           Data.Typeable-import           Text.Regex.Base-import           Text.RE-import           Text.RE.Internal.AddCaptureNames-import           Text.RE.PCRE.RE-import qualified Text.Regex.PCRE               as PCRE----- | find all matches in text-(*=~) :: LBS.ByteString-      -> RE-      -> Matches LBS.ByteString-(*=~) bs rex = addCaptureNamesToMatches (reCaptureNames rex) $ match (reRegex rex) bs---- | find first match in text-(?=~) :: LBS.ByteString-      -> RE-      -> Match LBS.ByteString-(?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs---- | 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-(=~~) :: ( Monad m-         , Functor m-         , Typeable a-         , RegexContext PCRE.Regex LBS.ByteString a-         , RegexMaker   PCRE.Regex PCRE.CompOption PCRE.ExecOption String-         )-      => LBS.ByteString-      -> RE-      -> m a-(=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs--instance IsRegex RE LBS.ByteString where-  matchOnce   = flip (?=~)-  matchMany   = flip (*=~)-  regexSource = reSource---- $tutorial--- We have a regex tutorial at <http://tutorial.regex.uk>. These API--- docs are mainly for reference.---- $toolkit------ Beyond the above match operators and the regular expression type--- below, "Text.RE" contains the toolkit for replacing captures,--- specifying options, etc.---- $re------ "Text.RE.PCRE.RE" contains the toolkit specific to the 'RE' type,--- the type generated by the gegex compiler.
− Text/RE/PCRE/RE.hs
@@ -1,251 +0,0 @@-{-# LANGUAGE NoImplicitPrelude          #-}-{-# LANGUAGE RecordWildCards            #-}-{-# LANGUAGE QuasiQuotes                #-}-{-# LANGUAGE TemplateHaskell            #-}-{-# LANGUAGE MultiParamTypeClasses      #-}-{-# LANGUAGE TypeSynonymInstances       #-}-{-# LANGUAGE FlexibleInstances          #-}-{-# LANGUAGE FlexibleContexts           #-}-{-# LANGUAGE CPP                        #-}-#if __GLASGOW_HASKELL__ >= 800-{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}-#endif-{-# OPTIONS_GHC -fno-warn-orphans       #-}--module Text.RE.PCRE.RE-  ( re-  , reMS-  , reMI-  , reBS-  , reBI-  , reMultilineSensitive-  , reMultilineInsensitive-  , reBlockSensitive-  , reBlockInsensitive-  , re_-  , cp-  , regexType-  , RE-  , reOptions-  , reSource-  , reCaptureNames-  , reRegex-  , Options-  , prelude-  , preludeEnv-  , preludeTestsFailing-  , preludeTable-  , preludeSummary-  , preludeSources-  , preludeSource-  , noPreludeOptions-  , defaultOptions-  , unpackSimpleRegexOptions-  , compileRegex-  , escape-  , escapeREString-  ) where--import           Data.Bits-import           Data.Functor.Identity-import           Language.Haskell.TH-import           Language.Haskell.TH.Quote-import           Prelude.Compat-import           Text.RE-import           Text.RE.Internal.EscapeREString-import           Text.RE.Internal.NamedCaptures-import           Text.RE.Internal.PreludeMacros-import           Text.RE.Internal.QQ-import           Text.RE.TestBench-import           Text.Regex.PCRE---re-  , reMS-  , reMI-  , reBS-  , reBI-  , reMultilineSensitive-  , reMultilineInsensitive-  , reBlockSensitive-  , reBlockInsensitive-  , re_ :: QuasiQuoter--re                       = re' $ Just minBound-reMS                     = reMultilineSensitive-reMI                     = reMultilineInsensitive-reBS                     = reBlockSensitive-reBI                     = reBlockInsensitive-reMultilineSensitive     = re' $ Just  MultilineSensitive-reMultilineInsensitive   = re' $ Just  MultilineInsensitive-reBlockSensitive         = re' $ Just  BlockSensitive-reBlockInsensitive       = re' $ Just  BlockInsensitive-re_                      = re'   Nothing--regexType :: RegexType-regexType = PCRE--data RE =-  RE-    { _re_options :: !Options-    , _re_source  :: !String-    , _re_cnames  :: !CaptureNames-    , _re_regex   :: !Regex-    }--reOptions :: RE -> Options-reOptions = _re_options--reSource :: RE -> String-reSource = _re_source--reCaptureNames :: RE -> CaptureNames-reCaptureNames = _re_cnames--reRegex  :: RE -> Regex-reRegex = _re_regex--type Options = Options_ RE CompOption ExecOption--instance IsOption SimpleRegexOptions RE CompOption ExecOption where-  makeOptions    = unpackSimpleRegexOptions--instance IsOption (Macros RE) RE CompOption ExecOption where-  makeOptions ms = Options ms def_comp_option def_exec_option--instance IsOption CompOption  RE CompOption ExecOption where-  makeOptions co = Options prelude co def_exec_option--instance IsOption ExecOption  RE CompOption ExecOption where-  makeOptions eo = Options prelude def_comp_option eo--instance IsOption Options     RE CompOption ExecOption where-  makeOptions    = id--instance IsOption ()          RE CompOption ExecOption where-  makeOptions _  = unpackSimpleRegexOptions minBound--def_comp_option :: CompOption-def_comp_option = optionsComp defaultOptions--def_exec_option :: ExecOption-def_exec_option = optionsExec defaultOptions--noPreludeOptions :: Options-noPreludeOptions = defaultOptions { optionsMacs = emptyMacros }--defaultOptions :: Options-defaultOptions = makeOptions (minBound::SimpleRegexOptions)--unpackSimpleRegexOptions :: SimpleRegexOptions -> Options-unpackSimpleRegexOptions sro =-  Options-    { optionsMacs = prelude-    , optionsComp = comp-    , optionsExec = defaultExecOpt-    }-  where-    comp =-      wiggle ml compMultiline $-      wiggle ci compCaseless-        defaultCompOpt--    wiggle True  m v = v .|.            m-    wiggle False m v = v .&. complement m--    (ml,ci) = case sro of-        MultilineSensitive    -> (,) True  False-        MultilineInsensitive  -> (,) True  True-        BlockSensitive        -> (,) False False-        BlockInsensitive      -> (,) False True--compileRegex :: ( IsOption o RE CompOption ExecOption-                , Functor m-                , Monad   m-                )-             => o-             -> String-             -> m RE-compileRegex = compileRegex_ . makeOptions--compileRegex_ :: ( Functor m , Monad m )-              => Options-              -> String-              -> m RE-compileRegex_ os re_s = uncurry mk <$> compileRegex' os re_s-  where-    mk cnms rex =-      RE-        { _re_options = os-        , _re_source  = re_s-        , _re_cnames  = cnms-        , _re_regex   = rex-        }--re' :: Maybe SimpleRegexOptions -> QuasiQuoter-re' mb = case mb of-  Nothing  ->-    (qq0 "re_")-      { quoteExp = parse minBound (\rs->[|flip unsafeCompileRegex rs|])-      }-  Just sro ->-    (qq0 "re")-      { quoteExp = parse sro (\rs->[|unsafeCompileRegexSimple sro rs|])-      }-  where-    parse :: SimpleRegexOptions -> (String->Q Exp) -> String -> Q Exp-    parse sro mk rs = either error (\_->mk rs) $ compileRegex_ os rs-      where-        os = unpackSimpleRegexOptions sro--unsafeCompileRegexSimple :: SimpleRegexOptions -> String -> RE-unsafeCompileRegexSimple sro re_s = unsafeCompileRegex os re_s-  where-    os = unpackSimpleRegexOptions sro--unsafeCompileRegex :: IsOption o RE CompOption ExecOption-                   => o-                   -> String-                   -> RE-unsafeCompileRegex = unsafeCompileRegex_ . makeOptions--unsafeCompileRegex_ :: Options -> String -> RE-unsafeCompileRegex_ os = either oops id . compileRegex os-  where-    oops = error . ("unsafeCompileRegex: " ++)--compileRegex' :: (Functor m,Monad m)-              => Options-              -> String-              -> m (CaptureNames,Regex)-compileRegex' Options{..} s0 = do-    (cnms,s2) <- either fail return $ extractNamedCaptures s1-    (,) cnms <$> makeRegexOptsM optionsComp optionsExec s2-  where-    s1 = expandMacros reSource optionsMacs s0--prelude :: Macros RE-prelude = runIdentity $ preludeMacros mk PCRE ExclCaptures-  where-    mk = Identity . unsafeCompileRegex_ noPreludeOptions--preludeTestsFailing :: [MacroID]-preludeTestsFailing = badMacros preludeEnv--preludeEnv :: MacroEnv-preludeEnv = preludeMacroEnv PCRE--preludeTable :: String-preludeTable = preludeMacroTable PCRE--preludeSummary :: PreludeMacro -> String-preludeSummary = preludeMacroSummary PCRE--preludeSources :: String-preludeSources = preludeMacroSources PCRE--preludeSource :: PreludeMacro -> String-preludeSource = preludeMacroSource PCRE--escape :: (String->String) -> String -> RE-escape f = unsafeCompileRegex () . f . escapeREString
− Text/RE/PCRE/Sequence.hs
@@ -1,91 +0,0 @@-{-# LANGUAGE NoImplicitPrelude          #-}-{-# LANGUAGE MultiParamTypeClasses      #-}-{-# LANGUAGE FlexibleContexts           #-}-{-# LANGUAGE FlexibleInstances          #-}-{-# OPTIONS_GHC -fno-warn-orphans       #-}-{-# LANGUAGE CPP                        #-}-#if __GLASGOW_HASKELL__ >= 800-{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}-#endif--module Text.RE.PCRE.Sequence-  (-  -- * Tutorial-  -- $tutorial--  -- * The Match Operators-    (*=~)-  , (?=~)-  , (=~)-  , (=~~)-  -- * The Toolkit-  -- $toolkit-  , module Text.RE-  -- * The 'RE' Type-  -- $re-  , module Text.RE.PCRE.RE-  ) where--import           Prelude.Compat-import qualified Data.Sequence                 as S-import           Data.Typeable-import           Text.Regex.Base-import           Text.RE-import           Text.RE.Internal.AddCaptureNames-import           Text.RE.PCRE.RE-import qualified Text.Regex.PCRE               as PCRE----- | find all matches in text-(*=~) :: (S.Seq Char)-      -> RE-      -> Matches (S.Seq Char)-(*=~) bs rex = addCaptureNamesToMatches (reCaptureNames rex) $ match (reRegex rex) bs---- | find first match in text-(?=~) :: (S.Seq Char)-      -> RE-      -> Match (S.Seq Char)-(?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs---- | 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-(=~~) :: ( 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-      -> m a-(=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs--instance IsRegex RE (S.Seq Char) where-  matchOnce   = flip (?=~)-  matchMany   = flip (*=~)-  regexSource = reSource---- $tutorial--- We have a regex tutorial at <http://tutorial.regex.uk>. These API--- docs are mainly for reference.---- $toolkit------ Beyond the above match operators and the regular expression type--- below, "Text.RE" contains the toolkit for replacing captures,--- specifying options, etc.---- $re------ "Text.RE.PCRE.RE" contains the toolkit specific to the 'RE' type,--- the type generated by the gegex compiler.
− Text/RE/PCRE/String.hs
@@ -1,91 +0,0 @@-{-# LANGUAGE NoImplicitPrelude          #-}-{-# LANGUAGE MultiParamTypeClasses      #-}-{-# LANGUAGE FlexibleContexts           #-}-{-# LANGUAGE FlexibleInstances          #-}-{-# OPTIONS_GHC -fno-warn-orphans       #-}-{-# LANGUAGE CPP                        #-}-#if __GLASGOW_HASKELL__ >= 800-{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}-#endif--module Text.RE.PCRE.String-  (-  -- * Tutorial-  -- $tutorial--  -- * The Match Operators-    (*=~)-  , (?=~)-  , (=~)-  , (=~~)-  -- * The Toolkit-  -- $toolkit-  , module Text.RE-  -- * The 'RE' Type-  -- $re-  , module Text.RE.PCRE.RE-  ) where--import           Prelude.Compat--import           Data.Typeable-import           Text.Regex.Base-import           Text.RE-import           Text.RE.Internal.AddCaptureNames-import           Text.RE.PCRE.RE-import qualified Text.Regex.PCRE               as PCRE----- | find all matches in text-(*=~) :: String-      -> RE-      -> Matches String-(*=~) bs rex = addCaptureNamesToMatches (reCaptureNames rex) $ match (reRegex rex) bs---- | find first match in text-(?=~) :: String-      -> RE-      -> Match String-(?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs---- | 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-(=~~) :: ( Monad m-         , Functor m-         , Typeable a-         , RegexContext PCRE.Regex String a-         , RegexMaker   PCRE.Regex PCRE.CompOption PCRE.ExecOption String-         )-      => String-      -> RE-      -> m a-(=~~) bs rex = addCaptureNames (reCaptureNames rex) <$> matchM (reRegex rex) bs--instance IsRegex RE String where-  matchOnce   = flip (?=~)-  matchMany   = flip (*=~)-  regexSource = reSource---- $tutorial--- We have a regex tutorial at <http://tutorial.regex.uk>. These API--- docs are mainly for reference.---- $toolkit------ Beyond the above match operators and the regular expression type--- below, "Text.RE" contains the toolkit for replacing captures,--- specifying options, etc.---- $re------ "Text.RE.PCRE.RE" contains the toolkit specific to the 'RE' type,--- the type generated by the gegex compiler.
Text/RE/TDFA/RE.hs view
@@ -82,7 +82,8 @@ re_                      = re'   Nothing  regexType :: RegexType-regexType = TDFA+regexType =+  TDFA $ \txt env md -> txt =~ mdRegexSource regexType ExclCaptures env md  data RE =   RE@@ -221,27 +222,27 @@     s1 = expandMacros reSource optionsMacs s0  prelude :: Macros RE-prelude = runIdentity $ preludeMacros mk TDFA ExclCaptures+prelude = runIdentity $ preludeMacros mk regexType ExclCaptures   where     mk = Identity . unsafeCompileRegex_ noPreludeOptions  preludeEnv :: MacroEnv-preludeEnv = preludeMacroEnv TDFA+preludeEnv = preludeMacroEnv regexType  preludeTestsFailing :: [MacroID]-preludeTestsFailing = badMacros $ preludeMacroEnv TDFA+preludeTestsFailing = badMacros $ preludeMacroEnv regexType  preludeTable :: String-preludeTable = preludeMacroTable TDFA+preludeTable = preludeMacroTable regexType  preludeSummary :: PreludeMacro -> String-preludeSummary = preludeMacroSummary TDFA+preludeSummary = preludeMacroSummary regexType  preludeSources :: String-preludeSources = preludeMacroSources TDFA+preludeSources = preludeMacroSources regexType  preludeSource :: PreludeMacro -> String-preludeSource = preludeMacroSource TDFA+preludeSource = preludeMacroSource regexType  escape :: (String->String) -> String -> RE escape f = unsafeCompileRegex () . f . escapeREString
Text/RE/TestBench.lhs view
@@ -11,6 +11,9 @@ module Text.RE.TestBench   ( MacroID(..)   , RegexType(..)+  , isTDFA+  , isPCRE+  , presentRegexType   , MacroEnv   , WithCaptures(..)   , MacroDescriptor(..)@@ -28,6 +31,7 @@   , formatMacroSources   , formatMacroSource   , testMacroDescriptors+  , mdRegexSource   ) where  import           Data.Array@@ -42,20 +46,39 @@ import           Text.RE.Capture import           Text.RE.Options import           Text.RE.Replace-import qualified Text.Regex.PCRE                as PCRE-import qualified Text.Regex.TDFA                as TDFA \end{code}  Types -----  \begin{code}--- | what kind of back end will be compiling the RE++type TestBenchMatcher =+    String -> MacroEnv -> MacroDescriptor -> Matches String++-- | what kind of back end will be compiling the RE, and its match+-- function data RegexType-  = TDFA    -- the TDFA back end-  | PCRE    -- the PCRE back end-  deriving (Bounded,Enum,Eq,Ord,Show)+  = TDFA TestBenchMatcher+  | PCRE TestBenchMatcher +-- | test RegexType for TDFA/PCREness+isTDFA, isPCRE :: RegexType -> Bool++isTDFA (TDFA _) = True+isTDFA (PCRE _) = False++isPCRE (TDFA _) = False+isPCRE (PCRE _) = True++presentRegexType :: RegexType -> String+presentRegexType (TDFA _) = "TDFA"+presentRegexType (PCRE _) = "PCRE"++instance Show RegexType where+  show (TDFA _) = "TDFA <function>"+  show (PCRE _) = "PCRE <function>"+ -- | do we need the captures in the RE or whould they be stripped out -- where possible data WithCaptures@@ -149,7 +172,7 @@     putStrLn $ "========================================================"     return False   where-    lab' = lab ++ " [" ++ show rty ++"]"+    lab' = lab ++ " [" ++ presentRegexType rty ++"]"  badMacros :: MacroEnv -> [MacroID] badMacros m_env =@@ -191,8 +214,8 @@     test_neg src = test_neg' mid rty parser   $ match_ src env md      match_ = case rty of-      TDFA -> match_tdfa-      PCRE -> match_pcre+      TDFA tbmf -> tbmf+      PCRE tbmf -> tbmf \end{code}  @@ -208,7 +231,7 @@     fp_t  = "docs/" ++ rty_s ++ "-" ++ lab ++ ".txt"     fp_s  = "docs/" ++ rty_s ++ "-" ++ lab ++ "-src.txt" -    rty_s = map toLower $ show rty+    rty_s = map toLower $ presentRegexType rty \end{code}  \begin{code}@@ -394,7 +417,7 @@ min_captures rty rets = length   [ ()     | REToken{..}<-rets-    , _ret_fixed || (_ret_grouping && rty==TDFA)+    , _ret_fixed || (_ret_grouping && isTDFA rty)     ] \end{code} @@ -413,7 +436,7 @@           False ->             case (,) _ret_grouping (_ret_capturing && wc==InclCaptures) of               (False,False) -> ""-              (True ,False) -> if rty==PCRE then "(?:" else "("+              (True ,False) -> if isPCRE rty then "(?:" else "("               (False,True ) -> "("               (True ,True ) -> "(" @@ -465,18 +488,6 @@ \end{code}  -scan_re----------\begin{code}-match_tdfa :: String -> MacroEnv -> MacroDescriptor -> Matches String-match_tdfa txt env md = txt TDFA.=~ mdRegexSource TDFA ExclCaptures env md--match_pcre :: String -> MacroEnv -> MacroDescriptor -> Matches String-match_pcre txt env md = txt PCRE.=~ mdRegexSource PCRE ExclCaptures env md-\end{code}-- mdRegexSource ------------- @@ -560,5 +571,5 @@   where     mid_s = getMacroID mid     neg_s = if is_neg then "-ve" else "+ve" :: String-    rty_s = show rty+    rty_s = presentRegexType rty \end{code}
changelog view
@@ -1,5 +1,8 @@ -*-change-log-*- +0.6.0.0 Chris Dornan <chris.dornan@irisconnect.co.uk> 2017-03-13+  * Split out rexex-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)   * Add escaping functions (#37)
regex.cabal view
@@ -1,5 +1,5 @@ Name:                   regex-Version:                0.5.0.0+Version:                0.6.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@@ -31,10 +31,11 @@ Source-Repository this     Type:               git     Location:           https://github.com/iconnect/regex.git-    Tag:                0.5.0.0+    Tag:                0.6.0.0   + Library     Hs-Source-Dirs:     .     Exposed-Modules:@@ -51,12 +52,6 @@       Text.RE.LineNo       Text.RE.Options       Text.RE.Parsers-      Text.RE.PCRE-      Text.RE.PCRE.ByteString-      Text.RE.PCRE.ByteString.Lazy-      Text.RE.PCRE.RE-      Text.RE.PCRE.Sequence-      Text.RE.PCRE.String       Text.RE.Replace       Text.RE.TDFA       Text.RE.TDFA.ByteString@@ -86,7 +81,6 @@       , hashable             >= 1.2.3.3       , heredoc              >= 0.2.0.0       , regex-base           >= 0.93.2-      , regex-pcre-builtin   >= 0.94.4.8.8.35       , regex-tdfa           >= 1.2.0       , regex-tdfa-text      >= 1.0.0.3       , template-haskell     >= 2.7@@ -97,5 +91,4 @@       , unordered-containers >= 0.2.5.1  ---- Generated from lib/cabal-masters/mega-regex with re-gen-cabals+-- Generated with re-gen-cabals