regex-with-pcre 0.10.0.1 → 0.10.0.2
raw patch · 8 files changed
+86/−137 lines, 8 filesdep ~basedep ~regexPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
Dependency ranges changed: base, regex
API changes (from Hackage documentation)
+ Text.RE.PCRE.ByteString: escapeREString :: String -> String
+ Text.RE.PCRE.ByteString.Lazy: escapeREString :: String -> String
+ Text.RE.PCRE.Sequence: escapeREString :: String -> String
+ Text.RE.PCRE.String: escapeREString :: String -> String
Files
- README.markdown +1/−3
- Text/RE/PCRE/ByteString.hs +18/−10
- Text/RE/PCRE/ByteString/Lazy.hs +18/−10
- Text/RE/PCRE/RE.hs +1/−88
- Text/RE/PCRE/Sequence.hs +18/−10
- Text/RE/PCRE/String.hs +18/−10
- changelog +9/−3
- regex-with-pcre.cabal +3/−3
README.markdown view
@@ -64,9 +64,7 @@ ☒ 2017-03-24 v0.9.0.0 [Finish tidying up the API, Add type-safe replacement templates and exploit TemplateHaskellQuotes](https://github.com/iconnect/regex/milestone/9) - ☒ 2017-03-25 v0.10.0.0 [Tweak TypeSafe SearchReplace templates](https://github.com/iconnect/regex/milestone/11)-- ☒ 2017-03-26 v0.10.0.1 [Fix release](https://github.com/iconnect/regex/issues/88)+ ☒ 2017-03-27 v0.10.0.2 [Tweak Templates, Fix release scripts and update Haddocks commentary](https://github.com/iconnect/regex/milestone/12) ☐ 2017-03-31 v1.0.0.0 [First stable release](https://github.com/iconnect/regex/milestone/3)
Text/RE/PCRE/ByteString.hs view
@@ -13,14 +13,14 @@ ( -- * Tutorial -- $tutorial- --- -- * The Match Operators++ -- * The 'Matches' and 'Match' Operators (*=~) , (?=~)- -- * The SearchReplace Operators+ -- * The 'SearchReplace' Operators , (*=~/) , (?=~/)- -- * The Classic rexex-base Match Operators+ -- * The Classic rexex-base match Operators , (=~) , (=~~) -- * Matches@@ -43,6 +43,7 @@ , compileRegexWith , escape , escapeWith+ , escapeREString , module Text.RE.PCRE.RE , module Text.RE.Internal.SearchReplace.PCRE.ByteString ) where@@ -62,7 +63,10 @@ import qualified Text.Regex.PCRE as PCRE --- | find all matches in text+-- | find all matches in text; e.g., to count the number of naturals in s:+--+-- @countMatches $ s *=~ [re|[0-9]+|]@+-- (*=~) :: B.ByteString -> RE -> Matches B.ByteString@@ -74,13 +78,17 @@ -> Match B.ByteString (?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs --- | search and replace once-(?=~/) :: B.ByteString -> SearchReplace RE B.ByteString -> B.ByteString-(?=~/) = flip searchReplaceFirst---- | search and replace, all occurrences+-- | search and replace all occurrences; e.g., this section will yield a function to+-- convert every a YYYY-MM-DD into a DD/MM/YYYY:+--+-- @(*=~/ [ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})///${d}/${m}/${y}|])@+-- (*=~/) :: B.ByteString -> SearchReplace RE B.ByteString -> B.ByteString (*=~/) = flip searchReplaceAll++-- | search and replace the first occurrence only+(?=~/) :: B.ByteString -> SearchReplace RE B.ByteString -> B.ByteString+(?=~/) = flip searchReplaceFirst -- | the regex-base polymorphic match operator (=~) :: ( Typeable a
Text/RE/PCRE/ByteString/Lazy.hs view
@@ -13,14 +13,14 @@ ( -- * Tutorial -- $tutorial- --- -- * The Match Operators++ -- * The 'Matches' and 'Match' Operators (*=~) , (?=~)- -- * The SearchReplace Operators+ -- * The 'SearchReplace' Operators , (*=~/) , (?=~/)- -- * The Classic rexex-base Match Operators+ -- * The Classic rexex-base match Operators , (=~) , (=~~) -- * Matches@@ -43,6 +43,7 @@ , compileRegexWith , escape , escapeWith+ , escapeREString , module Text.RE.PCRE.RE , module Text.RE.Internal.SearchReplace.PCRE.ByteString.Lazy ) where@@ -62,7 +63,10 @@ import qualified Text.Regex.PCRE as PCRE --- | find all matches in text+-- | find all matches in text; e.g., to count the number of naturals in s:+--+-- @countMatches $ s *=~ [re|[0-9]+|]@+-- (*=~) :: LBS.ByteString -> RE -> Matches LBS.ByteString@@ -74,13 +78,17 @@ -> Match LBS.ByteString (?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs --- | search and replace once-(?=~/) :: LBS.ByteString -> SearchReplace RE LBS.ByteString -> LBS.ByteString-(?=~/) = flip searchReplaceFirst---- | search and replace, all occurrences+-- | search and replace all occurrences; e.g., this section will yield a function to+-- convert every a YYYY-MM-DD into a DD/MM/YYYY:+--+-- @(*=~/ [ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})///${d}/${m}/${y}|])@+-- (*=~/) :: LBS.ByteString -> SearchReplace RE LBS.ByteString -> LBS.ByteString (*=~/) = flip searchReplaceAll++-- | search and replace the first occurrence only+(?=~/) :: LBS.ByteString -> SearchReplace RE LBS.ByteString -> LBS.ByteString+(?=~/) = flip searchReplaceFirst -- | the regex-base polymorphic match operator (=~) :: ( Typeable a
Text/RE/PCRE/RE.hs view
@@ -59,16 +59,6 @@ , reBlockSensitive , reBlockInsensitive , re_- -- , ed- -- , edMS- -- , edMI- -- , edBS- -- , edBI- -- , edMultilineSensitive- -- , edMultilineInsensitive- -- , edBlockSensitive- -- , edBlockInsensitive- -- , ed_ , cp ) where @@ -323,16 +313,6 @@ , reBlockSensitive , reBlockInsensitive , re_ :: QuasiQuoter- -- , ed- -- , edMS- -- , edMI- -- , edBS- -- , edBI- -- , edMultilineSensitive- -- , edMultilineInsensitive- -- , edBlockSensitive- -- , edBlockInsensitive- -- , ed_ :: QuasiQuoter re = re' $ Just minBound reMS = reMultilineSensitive@@ -345,18 +325,7 @@ reBlockInsensitive = re' $ Just BlockInsensitive re_ = re' Nothing --- ed = ed' $ Just minBound--- edMS = edMultilineSensitive--- edMI = edMultilineInsensitive--- edBS = edBlockSensitive--- edBI = edBlockInsensitive--- edMultilineSensitive = ed' $ Just MultilineSensitive--- edMultilineInsensitive = ed' $ Just MultilineInsensitive--- edBlockSensitive = ed' $ Just BlockSensitive--- edBlockInsensitive = ed' $ Just BlockInsensitive--- ed_ = ed' Nothing - ------------------------------------------------------------------------ -- re Helpers ------------------------------------------------------------------------@@ -419,64 +388,8 @@ --------------------------------------------------------------------------- ed Helpers+-- Helpers ---------------------------------------------------------------------------- edS :: QuasiQuoter--- edS = cast_ed [|\x -> x :: SearchReplace RE String|] $ Just minBound------ edS_ :: QuasiQuoter--- edS_ = cast_ed [|\x -> x :: SimpleREOptions -> SearchReplace RE String|] Nothing------ cast_ed :: Q Exp -> Maybe SimpleREOptions -> QuasiQuoter--- cast_ed qe mb = case mb of--- Nothing ->--- (qq0 "ed'")--- { quoteExp = parse minBound $ \rs -> AppE <$> qe <*> [|flip unsafe_compile_sr rs|]--- }--- Just sro ->--- (qq0 "ed'")--- { quoteExp = parse sro $ \rs -> AppE <$> qe <*> [|unsafe_compile_sr_simple sro rs|]--- }--- where--- parse :: SimpleREOptions -> (String->Q Exp) -> String -> Q Exp--- parse sro mk ts = either error (\_->mk ts) ei--- where--- ei :: Either String (SearchReplace RE String)--- ei = compileSearchReplace_ id (compileRegexWith sro) ts------ ed' :: Maybe SimpleREOptions -> QuasiQuoter--- ed' mb = case mb of--- Nothing ->--- (qq0 "ed'")--- { quoteExp = parse minBound (\rs->[|flip unsafe_compile_sr rs|])--- }--- Just sro ->--- (qq0 "ed'")--- { quoteExp = parse sro (\rs->[|unsafe_compile_sr_simple sro rs|])--- }--- where--- parse :: SimpleREOptions -> (String->Q Exp) -> String -> Q Exp--- parse sro mk ts = either error (\_->mk ts) ei--- where--- ei :: Either String (SearchReplace RE String)--- ei = compileSearchReplace_ id (compileRegexWith sro) ts------ unsafe_compile_sr_simple :: IsRegex RE s--- => SimpleREOptions--- -> String--- -> SearchReplace RE s--- unsafe_compile_sr_simple sro =--- unsafe_compile_sr $ unpackSimpleREOptions sro------ unsafe_compile_sr :: ( IsOption o RE CompOption ExecOption--- , IsRegex RE s--- )--- => o--- -> String--- -> SearchReplace RE s--- unsafe_compile_sr os =--- unsafeCompileSearchReplace_ packR $ compileRegexWithOptions os def_comp_option :: CompOption def_comp_option = optionsComp defaultREOptions
Text/RE/PCRE/Sequence.hs view
@@ -13,14 +13,14 @@ ( -- * Tutorial -- $tutorial- --- -- * The Match Operators++ -- * The 'Matches' and 'Match' Operators (*=~) , (?=~)- -- * The SearchReplace Operators+ -- * The 'SearchReplace' Operators , (*=~/) , (?=~/)- -- * The Classic rexex-base Match Operators+ -- * The Classic rexex-base match Operators , (=~) , (=~~) -- * Matches@@ -43,6 +43,7 @@ , compileRegexWith , escape , escapeWith+ , escapeREString , module Text.RE.PCRE.RE , module Text.RE.Internal.SearchReplace.PCRE.Sequence ) where@@ -62,7 +63,10 @@ import qualified Text.Regex.PCRE as PCRE --- | find all matches in text+-- | find all matches in text; e.g., to count the number of naturals in s:+--+-- @countMatches $ s *=~ [re|[0-9]+|]@+-- (*=~) :: (S.Seq Char) -> RE -> Matches (S.Seq Char)@@ -74,13 +78,17 @@ -> Match (S.Seq Char) (?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs --- | search and replace once-(?=~/) :: (S.Seq Char) -> SearchReplace RE (S.Seq Char) -> (S.Seq Char)-(?=~/) = flip searchReplaceFirst---- | search and replace, all occurrences+-- | search and replace all occurrences; e.g., this section will yield a function to+-- convert every a YYYY-MM-DD into a DD/MM/YYYY:+--+-- @(*=~/ [ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})///${d}/${m}/${y}|])@+-- (*=~/) :: (S.Seq Char) -> SearchReplace RE (S.Seq Char) -> (S.Seq Char) (*=~/) = flip searchReplaceAll++-- | search and replace the first occurrence only+(?=~/) :: (S.Seq Char) -> SearchReplace RE (S.Seq Char) -> (S.Seq Char)+(?=~/) = flip searchReplaceFirst -- | the regex-base polymorphic match operator (=~) :: ( Typeable a
Text/RE/PCRE/String.hs view
@@ -13,14 +13,14 @@ ( -- * Tutorial -- $tutorial- --- -- * The Match Operators++ -- * The 'Matches' and 'Match' Operators (*=~) , (?=~)- -- * The SearchReplace Operators+ -- * The 'SearchReplace' Operators , (*=~/) , (?=~/)- -- * The Classic rexex-base Match Operators+ -- * The Classic rexex-base match Operators , (=~) , (=~~) -- * Matches@@ -43,6 +43,7 @@ , compileRegexWith , escape , escapeWith+ , escapeREString , module Text.RE.PCRE.RE , module Text.RE.Internal.SearchReplace.PCRE.String ) where@@ -62,7 +63,10 @@ import qualified Text.Regex.PCRE as PCRE --- | find all matches in text+-- | find all matches in text; e.g., to count the number of naturals in s:+--+-- @countMatches $ s *=~ [re|[0-9]+|]@+-- (*=~) :: String -> RE -> Matches String@@ -74,13 +78,17 @@ -> Match String (?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs --- | search and replace once-(?=~/) :: String -> SearchReplace RE String -> String-(?=~/) = flip searchReplaceFirst---- | search and replace, all occurrences+-- | search and replace all occurrences; e.g., this section will yield a function to+-- convert every a YYYY-MM-DD into a DD/MM/YYYY:+--+-- @(*=~/ [ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})///${d}/${m}/${y}|])@+-- (*=~/) :: String -> SearchReplace RE String -> String (*=~/) = flip searchReplaceAll++-- | search and replace the first occurrence only+(?=~/) :: String -> SearchReplace RE String -> String+(?=~/) = flip searchReplaceFirst -- | the regex-base polymorphic match operator (=~) :: ( Typeable a
changelog view
@@ -1,11 +1,17 @@ -*-change-log-*- +0.10.0.2 Chris Dornan <chris.dornan@irisconnect.co.uk> 2017-03-27+ * Constrain the types of the template quasi quoters (#86)+ * Add escape methods to IsRegex (#87)+ * Better Haddock Commentary (#90)+ * Better release-testing scripts (#91)+ * Make travis stack-release tests advisory (#92)+ 0.10.0.1 Chris Dornan <chris.dornan@irisconnect.co.uk> 2017-03-26- * Fix sub-package cabal files (#88)+ Withdrawn 0.10.0.0 Chris Dornan <chris.dornan@irisconnect.co.uk> 2017-03-25- * Tweak Type-Safe SearchReplace templates (#86)- * Add escape methods to IsRegex (#87)+ Withdrawn 0.9.0.0 Chris Dornan <chris.dornan@irisconnect.co.uk> 2017-03-23 * Flip the order of the arguments to replace (#78)
regex-with-pcre.cabal view
@@ -1,5 +1,5 @@ Name: regex-with-pcre-Version: 0.10.0.1+Version: 0.10.0.2 Synopsis: Toolkit for regex-base Description: A Regular Expression Toolkit for regex-base with Compile-time checking of RE syntax, data types for@@ -31,7 +31,7 @@ Source-Repository this Type: git Location: https://github.com/iconnect/regex.git- Tag: 0.10.0.1+ Tag: 0.10.0.2 @@ -89,7 +89,7 @@ -Wwarn Build-depends:- regex == 0.10.0.1+ regex == 0.10.0.2 , base >= 4 && < 5 , base-compat >= 0.6.0 , bytestring >= 0.10.2.0