Hello community, here is the log from the commit of package ghc-regex-tdfa for openSUSE:Factory checked in at 2019-05-17 23:43:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-regex-tdfa (Old) and /work/SRC/openSUSE:Factory/.ghc-regex-tdfa.new.5148 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-regex-tdfa" Fri May 17 23:43:02 2019 rev:8 rq:703477 version:1.2.3.2 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-regex-tdfa/ghc-regex-tdfa.changes 2018-10-25 09:03:19.746615326 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-regex-tdfa.new.5148/ghc-regex-tdfa.changes 2019-05-17 23:43:06.709914510 +0200 @@ -1,0 +2,8 @@ +Fri May 10 13:28:35 UTC 2019 - [email protected] + +- Update regex-tdfa to version 1.2.3.2. + # 1.2.3.2 + + * Significantly improved documentation (h/t William Yao). + +------------------------------------------------------------------- Old: ---- regex-tdfa-1.2.3.1.tar.gz New: ---- regex-tdfa-1.2.3.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-regex-tdfa.spec ++++++ --- /var/tmp/diff_new_pack.LxqY2Q/_old 2019-05-17 23:43:09.433913013 +0200 +++ /var/tmp/diff_new_pack.LxqY2Q/_new 2019-05-17 23:43:09.437913011 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-regex-tdfa # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %global pkg_name regex-tdfa Name: ghc-%{pkg_name} -Version: 1.2.3.1 +Version: 1.2.3.2 Release: 0 Summary: Replaces/Enhances Text.Regex License: BSD-3-Clause ++++++ regex-tdfa-1.2.3.1.tar.gz -> regex-tdfa-1.2.3.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/regex-tdfa-1.2.3.1/CHANGELOG.md new/regex-tdfa-1.2.3.2/CHANGELOG.md --- old/regex-tdfa-1.2.3.1/CHANGELOG.md 2018-06-22 10:56:03.000000000 +0200 +++ new/regex-tdfa-1.2.3.2/CHANGELOG.md 2019-05-09 11:08:35.000000000 +0200 @@ -1,3 +1,7 @@ +# 1.2.3.2 + +* Significantly improved documentation (h/t William Yao). + # 1.2.3.1 * Compatibility with `containers-0.6`. @@ -37,7 +41,7 @@ # 1.1.4 -fixed +fixed # 1.1.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/regex-tdfa-1.2.3.1/Text/Regex/TDFA/ByteString/Lazy.hs new/regex-tdfa-1.2.3.2/Text/Regex/TDFA/ByteString/Lazy.hs --- old/regex-tdfa-1.2.3.1/Text/Regex/TDFA/ByteString/Lazy.hs 2018-06-22 10:38:28.000000000 +0200 +++ new/regex-tdfa-1.2.3.2/Text/Regex/TDFA/ByteString/Lazy.hs 2019-05-08 23:56:36.000000000 +0200 @@ -1,6 +1,6 @@ -{-| +{-| This modules provides 'RegexMaker' and 'RegexLike' instances for using -'ByteString' with the DFA backend ("Text.Regex.Lib.WrapDFAEngine" and +@ByteString@ with the DFA backend ("Text.Regex.Lib.WrapDFAEngine" and "Text.Regex.Lazy.DFAEngineFPS"). This module is usually used via import "Text.Regex.TDFA". @@ -45,7 +45,7 @@ matchCount r s = length (matchAll r' s) where r' = r { regex_execOptions = (regex_execOptions r) {captureGroups = False} } matchTest = Tester.matchTest - matchOnceText regex source = + matchOnceText regex source = fmap (\ma -> let (o32,l32) = ma!0 o = fi o32 @@ -64,7 +64,7 @@ let (off0,len0) = x!0 trans pair@(off32,len32) = (L.take (fi len32) (L.drop (fi (off32-i)) t),pair) t' = L.drop (fi (off0+len0-i)) t - in amap trans x : seq t' (go (off0+len0) t' xs) + in amap trans x : seq t' (go (off0+len0) t' xs) in go 0 source (matchAll regex source) fi :: (Integral a, Num b) => a -> b diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/regex-tdfa-1.2.3.1/Text/Regex/TDFA/ByteString.hs new/regex-tdfa-1.2.3.2/Text/Regex/TDFA/ByteString.hs --- old/regex-tdfa-1.2.3.1/Text/Regex/TDFA/ByteString.hs 2018-06-22 10:38:28.000000000 +0200 +++ new/regex-tdfa-1.2.3.2/Text/Regex/TDFA/ByteString.hs 2019-05-08 23:56:36.000000000 +0200 @@ -1,6 +1,6 @@ -{-| +{-| This modules provides 'RegexMaker' and 'RegexLike' instances for using -'ByteString' with the DFA backend ("Text.Regex.Lib.WrapDFAEngine" and +@ByteString@ with the DFA backend ("Text.Regex.Lib.WrapDFAEngine" and "Text.Regex.Lazy.DFAEngineFPS"). This module is usually used via import "Text.Regex.TDFA". @@ -44,7 +44,7 @@ matchCount r s = length (matchAll r' s) where r' = r { regex_execOptions = (regex_execOptions r) {captureGroups = False} } matchTest = Tester.matchTest - matchOnceText regex source = + matchOnceText regex source = fmap (\ma -> let (o,l) = ma!0 in (B.take o source ,fmap (\ol@(off,len) -> (B.take len (B.drop off source),ol)) ma diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/regex-tdfa-1.2.3.1/Text/Regex/TDFA/Sequence.hs new/regex-tdfa-1.2.3.2/Text/Regex/TDFA/Sequence.hs --- old/regex-tdfa-1.2.3.1/Text/Regex/TDFA/Sequence.hs 2018-06-22 10:38:28.000000000 +0200 +++ new/regex-tdfa-1.2.3.2/Text/Regex/TDFA/Sequence.hs 2019-05-08 23:56:36.000000000 +0200 @@ -1,6 +1,6 @@ -{-| +{-| This modules provides 'RegexMaker' and 'RegexLike' instances for using -'ByteString' with the DFA backend ("Text.Regex.Lib.WrapDFAEngine" and +@ByteString@ with the DFA backend ("Text.Regex.Lib.WrapDFAEngine" and "Text.Regex.Lazy.DFAEngineFPS"). This module is usually used via import "Text.Regex.TDFA". @@ -49,7 +49,7 @@ matchCount r s = length (matchAll r' s) where r' = r { regex_execOptions = (regex_execOptions r) {captureGroups = False} } matchTest = Tester.matchTest - matchOnceText regex source = + matchOnceText regex source = fmap (\ma -> let (o,l) = ma!0 in (before o source ,fmap (\ol -> (extract ol source,ol)) ma diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/regex-tdfa-1.2.3.1/Text/Regex/TDFA.hs new/regex-tdfa-1.2.3.2/Text/Regex/TDFA.hs --- old/regex-tdfa-1.2.3.1/Text/Regex/TDFA.hs 2018-06-22 10:38:28.000000000 +0200 +++ new/regex-tdfa-1.2.3.2/Text/Regex/TDFA.hs 2019-05-08 23:56:36.000000000 +0200 @@ -1,4 +1,4 @@ -{-| +{-| The "Text.Regex.TDFA" module provides a backend for regular expressions. It provides instances for the classes defined and @@ -12,13 +12,114 @@ <http://www.haskell.org/haskellwiki/Regex_Posix> for examples of your OS's bugs. += Importing and using + +Add to your package.yaml/cabal file: + +> dependencies: +> - regex-tdfa + +In modules where you need to use regexes: + +> import Text.Regex.TDFA + +Note that regex-tdfa does not provide support for @Text@ by default. +If you need this functionality, add <https://hackage.haskell.org/package/regex-tdfa-text regex-tdfa-text> +as a dependency and @import Text.Regex.TDFA.Text ()@. + += Basics + +@ +λ> let emailRegex = "[a-zA-Z0-9+.\_-]+\@[a-zA-Z-]+\\\\.[a-z]+" +λ> "my email is [email protected]" '=~' emailRegex :: Bool +>>> True + +/-- non-monadic/ +λ> \<to-match-against\> '=~' \<regex\> + +/-- monadic, uses 'fail' on lack of match/ +λ> \<to-match-against\> '=~~' \<regex\> +@ + +('=~') and ('=~~') are polymorphic in their return type. This is so that +regex-tdfa can pick the most efficient way to give you your result based on +what you need. For instance, if all you want is to check whether the regex +matched or not, there's no need to allocate a result string. If you only want +the first match, rather than all the matches, then the matching engine can stop +after finding a single hit. + +This does mean, though, that you may sometimes have to explicitly specify the +type you want, especially if you're trying things out at the REPL. + += Common use cases + +== Get the first match + +@ +/-- returns empty string if no match/ +a '=~' b :: String /-- or ByteString, or Text.../ + +λ> "alexis-de-tocqueville" '=~' "[a-z]+" :: String +>>> "alexis" + +λ> "alexis-de-tocqueville" '=~' "[0-9]+" :: String +>>> "" +@ + +== Check if it matched at all + +@ +a '=~' b :: Bool + +λ> "alexis-de-tocqueville" '=~' "[a-z]+" :: Bool +>>> True +@ + +== Get first match + text before/after + +@ +/-- if no match, will just return whole/ +/-- string in the first element of the tuple/ +a =~ b :: (String, String, String) + +λ> "alexis-de-tocqueville" '=~' "de" :: (String, String, String) +>>> ("alexis-", "de", "-tocqueville") + +λ> "alexis-de-tocqueville" '=~' "kant" :: (String, String, String) +>>> ("alexis-de-tocqueville", "", "") +@ + +== Get first match + submatches + +@ +/-- same as above, but also returns a list of just submatches./ +/-- submatch list is empty if regex doesn't match at all/ +a '=~' b :: (String, String, String, [String]) + +λ> "div[attr=1234]" '=~' "div\\\\[([a-z]+)=([^]]+)\\\\]" :: (String, String, String, [String]) +>>> ("", "div[attr=1234]", "", ["attr","1234"]) +@ + +== Get /all/ matches + +@ +/-- can also return Data.Array instead of List/ +'getAllTextMatches' (a '=~' b) :: [String] + +λ> 'getAllTextMatches' ("john anne yifan" '=~' "[a-z]+") :: [String] +>>> ["john","anne","yifan"] +@ + += Feature support + This package does provide captured parenthesized subexpressions. Depending on the text being searched this package supports Unicode. -The [Char] and (Seq Char) text types support Unicode. The ByteString -and ByteString.Lazy text types only support ASCII. It is possible to -support utf8 encoded ByteString.Lazy by using regex-tdfa and -regex-tdfa-utf8 packages together (required the utf8-string package). +The @[Char]@ and @(Seq Char)@ text types support Unicode. The @ByteString@ +and @ByteString.Lazy@ text types only support ASCII. It is possible to +support utf8 encoded @ByteString.Lazy@ by using regex-tdfa and +<http://hackage.haskell.org/package/regex-tdfa-utf8 regex-tdfa-utf8> +packages together (required the utf8-string package). As of version 1.1.1 the following GNU extensions are recognized, all anchors: @@ -47,7 +148,26 @@ package does not provide back references inside regular expressions. The package does not provide Perl style regular expressions. Please -look at the regex-pcre and pcre-light packages instead. +look at the <http://hackage.haskell.org/package/regex-pcre regex-pcre> +and <http://hackage.haskell.org/package/pcre-light pcre-light> packages instead. + +This package does not provide find-and-replace. + += Avoiding backslashes + +If you find yourself writing a lot of regexes, take a look at +<http://hackage.haskell.org/package/raw-strings-qq raw-strings-qq>. It'll +let you write regexes without needing to escape all your backslashes. + +@ +\{\-\# LANGUAGE QuasiQuotes \#\-\} + +import Text.RawString.QQ +import Text.Regex.TDFA + +λ> "2 * (3 + 1) / 4" '=~' [r|\\([^)]+\\)|] :: String +>>> "(3 + 1)" +@ -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/regex-tdfa-1.2.3.1/regex-tdfa.cabal new/regex-tdfa-1.2.3.2/regex-tdfa.cabal --- old/regex-tdfa-1.2.3.1/regex-tdfa.cabal 2018-06-22 10:56:06.000000000 +0200 +++ new/regex-tdfa-1.2.3.2/regex-tdfa.cabal 2019-05-09 11:07:43.000000000 +0200 @@ -1,5 +1,5 @@ Name: regex-tdfa -Version: 1.2.3.1 +Version: 1.2.3.2 License: BSD3 License-File: LICENSE Copyright: Copyright (c) 2007, Christopher Kuklewicz @@ -11,7 +11,13 @@ Synopsis: Replaces/Enhances Text.Regex Description: A new all Haskell "tagged" DFA regex engine, inspired by libtre Category: Text -Tested-With: GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.1, GHC == 8.2.2, GHC == 8.4.1 +Tested-With: GHC==7.6.3 + , GHC==7.8.4 + , GHC==7.10.3 + , GHC==8.0.2 + , GHC==8.2.2 + , GHC==8.4.4 + , GHC==8.6.4 Build-Type: Simple extra-source-files: CHANGELOG.md @@ -26,7 +32,7 @@ default: False manual: True -library +library Build-Depends: array >= 0.4 && < 0.6 , base >= 4 && < 5 , bytestring >= 0.10 && < 0.11
