regex 0.10.0.1 → 0.10.0.2
raw patch · 11 files changed
+120/−147 lines, 11 filesdep ~basedep ~base-compatPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
Dependency ranges changed: base, base-compat
API changes (from Hackage documentation)
+ Text.RE.TDFA.ByteString: escapeREString :: String -> String
+ Text.RE.TDFA.ByteString.Lazy: escapeREString :: String -> String
+ Text.RE.TDFA.Sequence: escapeREString :: String -> String
+ Text.RE.TDFA.String: escapeREString :: String -> String
+ Text.RE.TDFA.Text: escapeREString :: String -> String
+ Text.RE.TDFA.Text.Lazy: escapeREString :: String -> String
Files
- README.markdown +1/−3
- Text/RE.hs +0/−19
- Text/RE/TDFA/ByteString.hs +18/−10
- Text/RE/TDFA/ByteString/Lazy.hs +18/−10
- Text/RE/TDFA/RE.hs +0/−60
- Text/RE/TDFA/Sequence.hs +18/−10
- Text/RE/TDFA/String.hs +18/−10
- Text/RE/TDFA/Text.hs +18/−10
- Text/RE/TDFA/Text/Lazy.hs +18/−10
- changelog +9/−3
- regex.cabal +2/−2
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.hs view
@@ -15,9 +15,6 @@ -- * How to use this library -- $use - -- ** The Match Operators- -- $operators- -- * Matches Matches , matchesSource@@ -74,19 +71,3 @@ -- * "Text.RE.PCRE.RE" -- * "Text.RE.PCRE.Sequence" -- * "Text.RE.PCRE.String"---- $operators------ The traditional @=~@ and @=~~@ operators are exported by the above--- API module, but we recommend that you use the two new operators,--- especially if you are not familiar with the old operators. We have:------ * @txt ?=~ re@ searches for a single match yielding a value of type--- 'Match' @a@ where @a@ is the type of the text you are searching.------ * @txt *=~ re@ searches for all non-overlapping matches in @txt@,--- returning a value of type 'Matches' @a@.------ The remainder of this module outlines these @Matches@ and--- @Match@ result types. Only an outline is given here. For more details--- see the 'Text.RE.Type.Matches' and 'Text.RE.Type.Match' modules.
Text/RE/TDFA/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.TDFA.RE , module Text.RE.Internal.SearchReplace.TDFA.ByteString ) where@@ -62,7 +63,10 @@ import qualified Text.Regex.TDFA as TDFA --- | 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/TDFA/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.TDFA.RE , module Text.RE.Internal.SearchReplace.TDFA.ByteString.Lazy ) where@@ -62,7 +63,10 @@ import qualified Text.Regex.TDFA as TDFA --- | 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/TDFA/RE.hs view
@@ -59,16 +59,6 @@ , reBlockSensitive , reBlockInsensitive , re_- -- , ed- -- , edMS- -- , edMI- -- , edBS- -- , edBI- -- , edMultilineSensitive- -- , edMultilineInsensitive- -- , edBlockSensitive- -- , edBlockInsensitive- -- , ed_ , cp ) where @@ -352,18 +342,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 ------------------------------------------------------------------------@@ -423,45 +402,6 @@ , _re_cnames = cnms , _re_regex = rx }------------------------------------------------------------------------------ ed Helpers----------------------------------------------------------------------------- ed' :: Maybe SimpleREOptions -> QuasiQuoter--- ed' mb = case mb of--- Nothing ->--- (qq0 "ed'")--- { quoteExp = parse minBound (\rs->[|flip unsafeCompileSearchReplace rs|])--- }--- Just sro ->--- (qq0 "ed'")--- { quoteExp = parse sro (\rs->[|unsafeCompileSearchReplaceSimple 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------ unsafeCompileSearchReplaceSimple :: IsRegex RE s--- => SimpleREOptions--- -> String--- -> SearchReplace RE s--- unsafeCompileSearchReplaceSimple sro re_s = unsafeCompileSearchReplace os re_s--- where--- os = unpackSimpleREOptions sro------ unsafeCompileSearchReplace :: ( IsOption o RE CompOption ExecOption--- , IsRegex RE s--- )--- => o--- -> String--- -> SearchReplace RE s--- unsafeCompileSearchReplace os =--- unsafeCompileSearchReplace_ packR $ compileRegexWithOptions os ------------------------------------------------------------------------
Text/RE/TDFA/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.TDFA.RE , module Text.RE.Internal.SearchReplace.TDFA.Sequence ) where@@ -62,7 +63,10 @@ import qualified Text.Regex.TDFA as TDFA --- | 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/TDFA/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.TDFA.RE , module Text.RE.Internal.SearchReplace.TDFA.String ) where@@ -62,7 +63,10 @@ import qualified Text.Regex.TDFA as TDFA --- | 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
Text/RE/TDFA/Text.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.TDFA.RE , module Text.RE.Internal.SearchReplace.TDFA.Text ) where@@ -62,7 +63,10 @@ import qualified Text.Regex.TDFA as TDFA --- | 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]+|]@+-- (*=~) :: T.Text -> RE -> Matches T.Text@@ -74,13 +78,17 @@ -> Match T.Text (?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs --- | search and replace once-(?=~/) :: T.Text -> SearchReplace RE T.Text -> T.Text-(?=~/) = 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}|])@+-- (*=~/) :: T.Text -> SearchReplace RE T.Text -> T.Text (*=~/) = flip searchReplaceAll++-- | search and replace the first occurrence only+(?=~/) :: T.Text -> SearchReplace RE T.Text -> T.Text+(?=~/) = flip searchReplaceFirst -- | the regex-base polymorphic match operator (=~) :: ( Typeable a
Text/RE/TDFA/Text/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.TDFA.RE , module Text.RE.Internal.SearchReplace.TDFA.Text.Lazy ) where@@ -62,7 +63,10 @@ import qualified Text.Regex.TDFA as TDFA --- | 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]+|]@+-- (*=~) :: TL.Text -> RE -> Matches TL.Text@@ -74,13 +78,17 @@ -> Match TL.Text (?=~) bs rex = addCaptureNamesToMatch (reCaptureNames rex) $ match (reRegex rex) bs --- | search and replace once-(?=~/) :: TL.Text -> SearchReplace RE TL.Text -> TL.Text-(?=~/) = 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}|])@+-- (*=~/) :: TL.Text -> SearchReplace RE TL.Text -> TL.Text (*=~/) = flip searchReplaceAll++-- | search and replace the first occurrence only+(?=~/) :: TL.Text -> SearchReplace RE TL.Text -> TL.Text+(?=~/) = 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.cabal view
@@ -1,5 +1,5 @@ Name: regex-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