Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ghc-regex-tdfa for openSUSE:Factory 
checked in at 2022-10-13 15:42:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-regex-tdfa (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-regex-tdfa.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-regex-tdfa"

Thu Oct 13 15:42:51 2022 rev:22 rq:1008505 version:1.3.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-regex-tdfa/ghc-regex-tdfa.changes    
2022-08-01 21:32:21.041992431 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-regex-tdfa.new.2275/ghc-regex-tdfa.changes  
2022-10-13 15:42:59.894837840 +0200
@@ -1,0 +2,9 @@
+Mon Jul 18 19:00:45 UTC 2022 - Peter Simons <[email protected]>
+
+- Update regex-tdfa to version 1.3.2.
+  Upstream has edited the change log file since the last release in
+  a non-trivial way, i.e. they did more than just add a new entry
+  at the top. You can review the file at:
+  http://hackage.haskell.org/package/regex-tdfa-1.3.2/src/CHANGELOG.md
+
+-------------------------------------------------------------------

Old:
----
  regex-tdfa-1.3.1.3.tar.gz

New:
----
  regex-tdfa-1.3.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-regex-tdfa.spec ++++++
--- /var/tmp/diff_new_pack.8yfAtY/_old  2022-10-13 15:43:00.410838848 +0200
+++ /var/tmp/diff_new_pack.8yfAtY/_new  2022-10-13 15:43:00.426838879 +0200
@@ -19,7 +19,7 @@
 %global pkg_name regex-tdfa
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        1.3.1.3
+Version:        1.3.2
 Release:        0
 Summary:        Pure Haskell Tagged DFA Backend for "Text.Regex" (regex-base)
 License:        BSD-3-Clause
@@ -37,6 +37,7 @@
 ExcludeArch:    %{ix86}
 %if %{with tests}
 BuildRequires:  ghc-directory-devel
+BuildRequires:  ghc-doctest-parallel-devel
 BuildRequires:  ghc-filepath-devel
 BuildRequires:  ghc-utf8-string-devel
 %endif

++++++ regex-tdfa-1.3.1.3.tar.gz -> regex-tdfa-1.3.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/regex-tdfa-1.3.1.3/CHANGELOG.md 
new/regex-tdfa-1.3.2/CHANGELOG.md
--- old/regex-tdfa-1.3.1.3/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200
+++ new/regex-tdfa-1.3.2/CHANGELOG.md   2001-09-09 03:46:40.000000000 +0200
@@ -1,11 +1,40 @@
 For the package version policy (PVP), see  http://pvp.haskell.org/faq .
 
+### 1.3.2
+
+_2022-07-18, Andreas Abel_
+
+- Export `decodePatternSet` and `decodeCharacterClass` from 
`Text.Regex.TDFA.Pattern`
+  ([#16](https://github.com/haskell-hvr/regex-tdfa/issues/16))
+- Extend and correct docs for `Pattern` module
+- Tested with GHC 7.4 - 9.4
+
+### 1.3.1.5
+
+_2022-07-18, Andreas Abel_
+
+- Allow dash (`-`) as start of a range, e.g. `[--z]`
+  ([#1](https://github.com/haskell-hvr/regex-tdfa/issues/1),
+  [#45](https://github.com/haskell-hvr/regex-tdfa/pull/45))
+- Tested with GHC 7.4 - 9.4
+
+### 1.3.1.4
+
+_2022-07-17, Andreas Abel_
+
+- Fix parsing of dashes in bracket expressions, e.g. `[-a-z]` 
([#1](https://github.com/haskell-hvr/regex-tdfa/issues/1))
+- Fix a deprecation warning except for on GHC 8.2 
([#21](https://github.com/haskell-hvr/regex-tdfa/issues/21))
+- Documentation: link `defaultComptOpt` to its definition  
([#13](https://github.com/haskell-hvr/regex-tdfa/issues/13))
+- Verify documentation examples with new `doc-test` testsuite
+- Tested with GHC 7.4 - 9.4
+
 ### 1.3.1.3
 
 _2022-07-14, Andreas Abel_
 
-- Fix an `undefined` in `Show PatternSet` 
[#37](https://github.com/haskell-hvr/regex-tdfa/issues/37))
-- Document POSIX character classes (e.g. `[[:digit:]]`)
+- Fix an `undefined` in `Show PatternSet` 
([#37](https://github.com/haskell-hvr/regex-tdfa/issues/37))
+- Document POSIX character classes (e.g. `[[:digit:]]`) in README
+- Tested with GHC 7.4 - 9.4
 
 ### 1.3.1.2 Revision 1
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/regex-tdfa-1.3.1.3/README.md 
new/regex-tdfa-1.3.2/README.md
--- old/regex-tdfa-1.3.1.3/README.md    2001-09-09 03:46:40.000000000 +0200
+++ new/regex-tdfa-1.3.2/README.md      2001-09-09 03:46:40.000000000 +0200
@@ -11,7 +11,7 @@
 [Declare a 
dependency](https://www.haskell.org/cabal/users-guide/developing-packages.html#pkg-field-build-depends)
 on the `regex-tdfa` library in your `.cabal` file:
 
 ```
-build-depends: regex-tdfa ^>= 1.3.1
+build-depends: regex-tdfa ^>= 1.3.2
 ```
 
 In Haskell modules where you need to use regexes `import` the respective 
`regex-tdfa` module:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/regex-tdfa-1.3.1.3/lib/Data/IntMap/CharMap2.hs 
new/regex-tdfa-1.3.2/lib/Data/IntMap/CharMap2.hs
--- old/regex-tdfa-1.3.1.3/lib/Data/IntMap/CharMap2.hs  2001-09-09 
03:46:40.000000000 +0200
+++ new/regex-tdfa-1.3.2/lib/Data/IntMap/CharMap2.hs    2001-09-09 
03:46:40.000000000 +0200
@@ -9,7 +9,7 @@
 import Data.Char as C(ord)
 import Data.List as L (map)
 import qualified Data.IntMap as M
-#if MIN_VERSION_containers(0,6,0)
+#if MIN_VERSION_containers(0,5,11)
 import qualified Data.IntMap.Internal.Debug as MD
 #else
 import qualified Data.IntMap as MD
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/regex-tdfa-1.3.1.3/lib/Data/IntMap/EnumMap2.hs 
new/regex-tdfa-1.3.2/lib/Data/IntMap/EnumMap2.hs
--- old/regex-tdfa-1.3.1.3/lib/Data/IntMap/EnumMap2.hs  2001-09-09 
03:46:40.000000000 +0200
+++ new/regex-tdfa-1.3.2/lib/Data/IntMap/EnumMap2.hs    2001-09-09 
03:46:40.000000000 +0200
@@ -4,7 +4,7 @@
 
 import Data.Foldable as F (Foldable(foldMap))
 import qualified Data.IntMap as M
-#if MIN_VERSION_containers(0,6,0)
+#if MIN_VERSION_containers(0,5,11)
 import qualified Data.IntMap.Internal.Debug as MD
 #else
 import qualified Data.IntMap as MD
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/regex-tdfa-1.3.1.3/lib/Text/Regex/TDFA/Common.hs 
new/regex-tdfa-1.3.2/lib/Text/Regex/TDFA/Common.hs
--- old/regex-tdfa-1.3.1.3/lib/Text/Regex/TDFA/Common.hs        2001-09-09 
03:46:40.000000000 +0200
+++ new/regex-tdfa-1.3.2/lib/Text/Regex/TDFA/Common.hs  2001-09-09 
03:46:40.000000000 +0200
@@ -1,7 +1,9 @@
 {-# OPTIONS -funbox-strict-fields #-}
--- | Common provides simple functions to the backend.  It defines most
--- of the data types.  All modules should call error via the
--- common_error function below.
+
+-- | Common provides simple functions to the backend.
+-- It defines most of the data types.
+-- All modules should call 'error' via the 'common_error' function below.
+
 module Text.Regex.TDFA.Common where
 
 import Text.Regex.Base(RegexOptions(..))
@@ -31,14 +33,14 @@
 on :: (t1 -> t1 -> t2) -> (t -> t1) -> t -> t -> t2
 f `on` g = (\x y -> (g x) `f` (g y))
 
--- | after 'sort' or 'sortBy' the use of 'nub'\/'nubBy' can be replaced by 
'norep'\/'norepBy'
+-- | After 'sort' or 'sortBy' the use of 'nub' or 'nubBy' can be replaced by 
'norep' or 'norepBy'.
 norep :: (Eq a) => [a]->[a]
 norep [] = []
 norep x@[_] = x
 norep (a:bs@(c:cs)) | a==c = norep (a:cs)
                     | otherwise = a:norep bs
 
--- | after 'sort' or 'sortBy' the use of 'nub'\/'nubBy' can be replaced by 
'norep'\/'norepBy'
+-- | After 'sort' or 'sortBy' the use of 'nub' or 'nubBy' can be replaced by 
'norep' or 'norepBy'.
 norepBy :: (a -> a -> Bool) -> [a] -> [a]
 norepBy _ [] = []
 norepBy _ x@[_] = x
@@ -68,8 +70,7 @@
 noWin :: WinTags -> Bool
 noWin = null
 
--- | Used to track elements of the pattern that accept characters or
--- are anchors
+-- | Used to track elements of the pattern that accept characters or are 
anchors.
 newtype DoPa = DoPa {dopaIndex :: Int} deriving (Eq,Ord)
 
 instance Enum DoPa where
@@ -82,48 +83,58 @@
 -- | Control whether the pattern is multiline or case-sensitive like 
Text.Regex and whether to
 -- capture the subgroups (\\1, \\2, etc).  Controls enabling extra anchor 
syntax.
 data CompOption = CompOption {
-    caseSensitive :: Bool    -- ^ True in blankCompOpt and defaultCompOpt
-  , multiline :: Bool {- ^ False in blankCompOpt, True in defaultCompOpt. 
Compile for
-                      newline-sensitive matching.  "By default, newline is a 
completely ordinary
-                      character with no special meaning in either REs or 
strings.  With this flag,
-                      inverted bracket expressions and . never match newline, 
a ^ anchor matches the
-                      null string after any newline in the string in addition 
to its normal
-                      function, and the $ anchor matches the null string 
before any newline in the
-                      string in addition to its normal function." -}
-  , rightAssoc :: Bool       -- ^ True (and therefore Right associative) in 
blankCompOpt and defaultCompOpt
-  , newSyntax :: Bool        -- ^ False in blankCompOpt, True in 
defaultCompOpt. Add the extended non-POSIX syntax described in 
"Text.Regex.TDFA" haddock documentation.
-  , lastStarGreedy ::  Bool  -- ^ False by default.  This is POSIX correct but 
it takes space and is slower.
-                            -- Setting this to true will improve performance, 
and should be done
-                            -- if you plan to set the captureGroups ExecOption 
to False.
+    caseSensitive :: Bool
+      -- ^ True in 'blankCompOpt' and 'defaultCompOpt'.
+  , multiline :: Bool
+      -- ^ False in 'blankCompOpt', True in 'defaultCompOpt'.
+      -- Compile for newline-sensitive matching.
+      --
+      -- From [regexp man 
page](https://www.tcl.tk/man/tcl8.4/TclCmd/regexp.html#M8):
+      -- "By default, newline is a completely ordinary character with no 
special meaning in either REs or strings.
+      -- With this flag, inverted bracket expressions @[^@ and @.@ never match 
newline,
+      -- a @^@ anchor matches the null string after any newline in the string 
in addition to its normal function,
+      -- and the @$@ anchor matches the null string before any newline in the 
string in addition to its normal function."
+  , rightAssoc :: Bool
+      -- ^ True (and therefore right associative) in 'blankCompOpt' and 
'defaultCompOpt'.
+  , newSyntax :: Bool
+      -- ^ False in 'blankCompOpt', True in 'defaultCompOpt'.
+      -- Enables the extended non-POSIX syntax described in "Text.Regex.TDFA" 
haddock documentation.
+  , lastStarGreedy ::  Bool
+      -- ^ False by default.  This is POSIX correct but it takes space and is 
slower.
+      -- Setting this to True will improve performance, and should be done
+      -- if you plan to set the 'captureGroups' 'ExecOption' to False.
   } deriving (Read,Show)
 
 data ExecOption = ExecOption {
     captureGroups :: Bool    -- ^ True by default.  Set to False to improve 
speed (and space).
   } deriving (Read,Show)
 
--- | Used by implementation to name certain Postions during
--- matching. Identity of Position tag to set during a transition
+-- | Used by implementation to name certain 'Postion's during
+-- matching. Identity of 'Position' tag to set during a transition.
 type Tag = Int
--- | Internal use to indicate type of tag and preference for larger or smaller 
Positions
+
+-- | Internal use to indicate type of tag and preference for larger or smaller 
'Position's.
 data OP = Maximize | Minimize | Orbit | Ignore deriving (Eq,Show)
--- | Internal NFA node identity number
+
+-- | Internal NFA node identity number.
 type Index = Int
--- | Internal DFA identity is this Set of NFA Index
+
+-- | Internal DFA identity is this 'Set' of NFA 'Index'.
 type SetIndex = IntSet {- Index -}
--- | Index into the text being searched
+
+-- | Index into the text being searched.
 type Position = Int
 
--- | GroupIndex is for indexing submatches from capturing
--- parenthesized groups (PGroup\/Group)
+-- | 'GroupIndex' is for indexing submatches from capturing parenthesized 
groups ('PGroup' or 'Group').
 type GroupIndex = Int
--- | GroupInfo collects the parent and tag information for an instance
--- of a group
+
+-- | 'GroupInfo' collects the parent and tag information for an instance of a 
group.
 data GroupInfo = GroupInfo {
     thisIndex, parentIndex :: GroupIndex
   , startTag, stopTag, flagTag :: Tag
   } deriving Show
 
--- | The TDFA backend specific 'Regex' type, used by this module's 
RegexOptions and RegexMaker
+-- | The TDFA backend specific 'Regex' type, used by this module's 
'RegexOptions' and 'RegexMaker'.
 data Regex = Regex {
     regex_dfa :: DFA                             -- ^ starting DFA state
   , regex_init :: Index                          -- ^ index of starting state
@@ -161,10 +172,10 @@
               | WinTest WhichTest (Maybe WinEmpty) (Maybe WinEmpty)
   deriving Show
 
--- | Internal NFA node type
+-- | Internal NFA node type.
 data QNFA = QNFA {q_id :: Index, q_qt :: QT}
 
--- | Internal to QNFA type.
+-- | Internal to 'QNFA' type.
 data QT = Simple { qt_win :: WinTags -- ^ empty transitions to the virtual 
winning state
                  , qt_trans :: CharMap QTrans -- ^ all ways to leave this QNFA 
to other or the same QNFA
                  , qt_other :: QTrans -- ^ default ways to leave this QNFA to 
other or the same QNFA
@@ -182,29 +193,38 @@
 -- Also support for GNU extensions is being added: \\\` beginning of
 -- buffer, \\\' end of buffer, \\\< and \\\> for begin and end of words, \\b
 -- and \\B for word boundary and not word boundary.
-data WhichTest = Test_BOL | Test_EOL -- '^' and '$' (affected by multiline 
option)
-               | Test_BOB | Test_EOB -- \` and \' begin and end buffer
-               | Test_BOW | Test_EOW -- \< and \> begin and end word
-               | Test_EdgeWord | Test_NotEdgeWord -- \b and \B word boundaries
+data WhichTest
+  = Test_BOL          -- ^ @^@ (affected by multiline option)
+  | Test_EOL          -- ^ @$@ (affected by multiline option)
+  | Test_BOB          -- ^ @\\`@ beginning of buffer
+  | Test_EOB          -- ^ @\\'@ end ofbuffer
+  | Test_BOW          -- ^ @\\<@ beginning of word
+  | Test_EOW          -- ^ @\\>@ end of word
+  | Test_EdgeWord     -- ^ @\\b@ word boundary
+  | Test_NotEdgeWord  -- ^ @\\B@ not word boundary
   deriving (Show,Eq,Ord,Enum)
 
--- | The things that can be done with a Tag.  TagTask and
--- ResetGroupStopTask are for tags with Maximize or Minimize OP
--- values.  ResetOrbitTask and EnterOrbitTask and LeaveOrbitTask are
+-- | The things that can be done with a Tag.  'TagTask' and
+-- 'ResetGroupStopTask' are for tags with Maximize or Minimize OP
+-- values.  'ResetOrbitTask' and 'EnterOrbitTask' and 'LeaveOrbitTask' are
 -- for tags with Orbit OP value.
 data TagTask = TagTask | ResetGroupStopTask | SetGroupStopTask
              | ResetOrbitTask | EnterOrbitTask | LeaveOrbitTask deriving 
(Show,Eq)
 
--- | Ordered list of tags and their associated Task
+-- | Ordered list of tags and their associated Task.
 type TagTasks = [(Tag,TagTask)]
+
 -- | When attached to a QTrans the TagTask can be done before or after
 -- accepting the character.
 data TagUpdate = PreUpdate TagTask | PostUpdate TagTask deriving (Show,Eq)
+
 -- | Ordered list of tags and their associated update operation.
 type TagList = [(Tag,TagUpdate)]
+
 -- | A TagList and the location of the item in the original pattern
 -- that is being accepted.
 type TagCommand = (DoPa,TagList)
+
 -- | Ordered list of tags and their associated update operation to
 -- perform on an empty transition to the virtual winning state.
 type WinTags = TagList
@@ -227,26 +247,25 @@
                    }
 
 -- | Internal type to represent the commands for the tagged transition.
--- The outer IntMap is for the destination Index and the inner IntMap
+-- The outer 'IntMap' is for the destination Index and the inner 'IntMap'
 -- is for the Source Index.  This is convenient since all runtime data
 -- going to the same destination must be compared to find the best.
 --
--- A Destination IntMap entry may have an empty Source IntMap if and
--- only if the destination is the starting index and the NFA\/DFA.
+-- A Destination 'IntMap' entry may have an empty Source 'IntMap' if and
+-- only if the destination is the starting index and the NFA or DFA.
 -- This instructs the matching engine to spawn a new entry starting at
 -- the post-update position.
 type DTrans = IntMap {- Index of Destination -} (IntMap {- Index of Source -} 
(DoPa,Instructions))
 -- type DTrans = IntMap {- Index of Destination -} (IntMap {- Index of Source 
-} (DoPa,RunState ()))
--- | Internal convenience type for the text display code
+
+-- | Internal convenience type for the text display code.
 type DTrans' = [(Index, [(Index, (DoPa, ([(Tag, 
(Position,Bool))],[String])))])]
 
--- | Positions for which a * was re-started while looping.  Need to
+-- | Positions for which a @*@ was re-started while looping.  Need to
 -- append locations at back but compare starting with front, so use
--- Seq as a Queue.  The initial position is saved in basePos (and a
--- Maximize Tag), the middle positions in the Seq, and the final
+-- 'Seq' as a queue.  The initial position is saved in 'basePos' (and a
+-- Maximize Tag), the middle positions in the 'Seq', and the final
 -- position is NOT saved in the Orbits (only in a Maximize Tag).
---
--- The original code is being written XXX TODO document it.
 data Orbits = Orbits
   { inOrbit :: !Bool        -- True if enterOrbit, False if LeaveOrbit
   , basePos :: Position
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/regex-tdfa-1.3.1.3/lib/Text/Regex/TDFA/Pattern.hs 
new/regex-tdfa-1.3.2/lib/Text/Regex/TDFA/Pattern.hs
--- old/regex-tdfa-1.3.1.3/lib/Text/Regex/TDFA/Pattern.hs       2001-09-09 
03:46:40.000000000 +0200
+++ new/regex-tdfa-1.3.2/lib/Text/Regex/TDFA/Pattern.hs 2001-09-09 
03:46:40.000000000 +0200
@@ -2,7 +2,7 @@
 
 -- | This "Text.Regex.TDFA.Pattern" module provides the 'Pattern' data
 -- type and its subtypes.  This 'Pattern' type is used to represent
--- the parsed form of a Regular Expression.
+-- the parsed form of a regular expression.
 
 module Text.Regex.TDFA.Pattern
     (Pattern(..)
@@ -12,52 +12,82 @@
     ,PatternSetEquivalenceClass(..)
     ,GroupIndex
     ,DoPa(..)
+    ,decodeCharacterClass, decodePatternSet
     ,showPattern
 -- ** Internal use
     ,starTrans
--- ** Internal use, Operations to support debugging under ghci
+-- ** Internal use, operations to support debugging under @ghci@
     ,starTrans',simplify',dfsPattern
     ) where
 
 {- By Chris Kuklewicz, 2007. BSD License, see the LICENSE file. -}
 
 import Data.List(intersperse,partition)
-import qualified Data.Set as Set(toAscList,toList)
-import Data.Set(Set) -- XXX EnumSet
+import qualified Data.Set as Set
+import Data.Set (Set)
 import Text.Regex.TDFA.Common(DoPa(..),GroupIndex,common_error)
 
 err :: String -> a
 err = common_error "Text.Regex.TDFA.Pattern"
 
--- | Pattern is the type returned by the regular expression parser.
--- This is consumed by the CorePattern module and the tender leaves
--- are nibbled by the TNFA module.
-data Pattern = PEmpty
-             | PGroup  (Maybe GroupIndex) Pattern -- Nothing to indicate 
non-matching PGroup (Nothing never used!)
-             | POr     [Pattern]                  -- flattened by starTrans
-             | PConcat [Pattern]                  -- flattened by starTrans
-             | PQuest  Pattern                    -- eliminated by starTrans
-             | PPlus   Pattern                    -- eliminated by starTrans
-             | PStar   Bool Pattern               -- True means mayFirstBeNull 
is True
-             | PBound  Int (Maybe Int) Pattern    -- eliminated by starTrans
-             -- The rest of these need an index of where in the regex string 
it is from
-             | PCarat  {getDoPa::DoPa}
-             | PDollar {getDoPa::DoPa}
-             -- The following test and accept a single character
-             | PDot    {getDoPa::DoPa}            -- Any character (newline?) 
at all
-             | PAny    {getDoPa::DoPa,getPatternSet::PatternSet} -- Square 
bracketed things
-             | PAnyNot {getDoPa::DoPa,getPatternSet::PatternSet} -- Inverted 
square bracketed things
-             | PEscape {getDoPa::DoPa,getPatternChar::Char}      -- 
Backslashed Character
-             | PChar   {getDoPa::DoPa,getPatternChar::Char}      -- Specific 
Character
-             -- The following are semantic tags created in starTrans, not the 
parser
-             | PNonCapture Pattern               -- introduced by starTrans
-             | PNonEmpty Pattern                 -- introduced by starTrans
-               deriving (Eq,Show)
-
--- | I have not been checking, but this should have the property that
--- parsing the resulting string should result in an identical Pattern.
--- This is not true if starTrans has created PNonCapture and PNonEmpty
--- values or a (PStar False).  The contents of a "[ ]" grouping are
+-- | 'Pattern' is the type returned by the regular expression parser 
'parseRegex'.
+-- This is consumed by the "Text.Regex.TDFA.CorePattern" module and the tender 
leaves
+-- are nibbled by the "Text.Regex.TDFA.TNFA" module.
+--
+-- The 'DoPa' field is the index of the component in the regex string @r@.
+data Pattern
+  = PEmpty
+      -- ^ @()@, matches the empty string.
+  | PGroup  (Maybe GroupIndex) Pattern
+      -- ^ Group @(r)@.  @Nothing@ indicates non-matching 'PGroup'
+      -- (never produced by parser 'parseRegex').
+  | POr     [Pattern]
+      -- ^ Alternative @r|s@ (flattened by 'starTrans').
+  | PConcat [Pattern]
+      -- ^ Sequence @rs@ (flattened by 'starTrans').
+  | PQuest  Pattern
+      -- ^ Zero or one repetitions @r?@ (eliminated by 'starTrans').
+  | PPlus   Pattern
+      -- ^ One or more repetitions @r+@ (eliminated by 'starTrans').
+  | PStar   Bool Pattern
+      -- ^ Zero or more repetitions @r*@.
+      -- @True@ (default) means may accept the empty string on its first 
iteration.
+  | PBound  Int (Maybe Int) Pattern
+      -- ^ Given number or repetitions @r{n}@ or @r{n,m}@
+      -- (eliminated by 'starTrans').
+
+  -- The rest of these need an index of where in the regex string it is from
+  | PCarat  { getDoPa :: DoPa }
+      -- ^ @^@ matches beginning of input.
+  | PDollar { getDoPa :: DoPa }
+      -- ^ @$@ matches end of input.
+
+  -- The following test and accept a single character
+  | PDot    { getDoPa :: DoPa }
+      -- ^ @.@ matches any character.
+  | PAny    { getDoPa :: DoPa, getPatternSet :: PatternSet }
+      -- ^ Bracket expression @[...]@.
+  | PAnyNot { getDoPa :: DoPa, getPatternSet :: PatternSet }
+      -- ^ Inverted bracket expression @[^...]@.
+  | PEscape { getDoPa :: DoPa, getPatternChar :: Char }
+      -- ^ Backslashed character @\c@, may have special meaning.
+  | PChar   { getDoPa :: DoPa, getPatternChar :: Char }
+      -- ^ Single character, matches given character.
+
+  -- The following are semantic tags created in starTrans, not the parser
+  | PNonCapture Pattern
+     -- ^ Tag for internal use, introduced by 'starTrans'.
+  | PNonEmpty Pattern
+     -- ^ Tag for internal use, introduced by 'starTrans'.
+  deriving (Eq, Show)
+
+-- Andreas Abel, 2022-07-18, issue #47:
+-- The following claim is FALSE:
+--
+-- I have not been checking, but this should have the property that
+-- parsing the resulting string should result in an identical 'Pattern'.
+-- This is not true if 'starTrans' has created 'PNonCapture' and 'PNonEmpty'
+-- values or a @'PStar' False@.  The contents of a @[...]@ grouping are
 -- always shown in a sorted canonical order.
 showPattern :: Pattern -> String
 showPattern pIn =
@@ -92,12 +122,19 @@
 -}
         paren s = ('(':s)++")"
 
+-- | Content of a bracket expression @[...]@ organized into
+-- characters,
+-- POSIX character classes (e.g. @[[:alnum:]]@),
+-- collating elements (e.g. @[.ch.]@, unused), and
+-- equivalence classes (e.g. @[=a=]@, treated as characters).
+--
 data PatternSet = PatternSet (Maybe (Set Char))
                              (Maybe (Set PatternSetCharacterClass))
                              (Maybe (Set PatternSetCollatingElement))
                              (Maybe (Set PatternSetEquivalenceClass))
                              deriving (Eq)
 
+-- | Hand-rolled implementation, giving textual rather than Haskell 
representation.
 instance Show PatternSet where
   showsPrec i (PatternSet s scc sce sec) =
     let (special,normal) = maybe ("","") ((partition (`elem` "]-")) . 
Set.toAscList) s
@@ -117,35 +154,79 @@
           groupRange x n [] = if n <=3 then take n [x..]
                               else x:'-':(toEnum (pred n+fromEnum x)):[]
 
+-- | Content of @[: :]@, e.g. @"alnum"@ for @[:alnum:]@.
 newtype PatternSetCharacterClass   = PatternSetCharacterClass   {unSCC::String}
   deriving (Eq,Ord)
+
+-- | Content of @[. .]@, e.g. @"ch"@ for @[.ch.]@.
 newtype PatternSetCollatingElement = PatternSetCollatingElement {unSCE::String}
   deriving (Eq,Ord)
+
+-- | Content of @[= =]@, e.g. @"a"@ for @[=a=]@.
 newtype PatternSetEquivalenceClass = PatternSetEquivalenceClass {unSEC::String}
   deriving (Eq,Ord)
 
+-- | Hand-rolled implementation, giving textual rather than Haskell 
representation.
 instance Show PatternSetCharacterClass where
   showsPrec _ p = showChar '[' . showChar ':' . shows (unSCC p) . showChar ':' 
. showChar ']'
+
+-- | Hand-rolled implementation, giving textual rather than Haskell 
representation.
 instance Show PatternSetCollatingElement where
   showsPrec _ p = showChar '[' . showChar '.' . shows (unSCE p) . showChar '.' 
. showChar ']'
+
+-- | Hand-rolled implementation, giving textual rather than Haskell 
representation.
 instance Show PatternSetEquivalenceClass where
   showsPrec _ p = showChar '[' . showChar '=' . shows (unSEC p) . showChar '=' 
. showChar ']'
 
+-- | @decodePatternSet@ cannot handle collating element and treats
+-- equivalence classes as just their definition and nothing more.
+--
+-- @since 1.3.2
+decodePatternSet :: PatternSet -> Set Char
+decodePatternSet (PatternSet msc mscc _ msec) =
+  let baseMSC = maybe Set.empty id msc
+      withMSCC = foldl (flip Set.insert) baseMSC  (maybe [] (concatMap 
decodeCharacterClass . Set.toAscList) mscc)
+      withMSEC = foldl (flip Set.insert) withMSCC (maybe [] (concatMap unSEC . 
Set.toAscList) msec)
+  in withMSEC
+
+-- | This returns the strictly ascending list of characters
+-- represented by @[: :]@ POSIX character classes.
+-- Unrecognized class names return an empty string.
+--
+-- @since 1.3.2
+decodeCharacterClass :: PatternSetCharacterClass -> String
+decodeCharacterClass (PatternSetCharacterClass s) =
+  case s of
+    "alnum"  -> ['0'..'9']++['A'..'Z']++['a'..'z']
+    "digit"  -> ['0'..'9']
+    "punct"  -> 
['\33'..'\47']++['\58'..'\64']++['\91'..'\96']++['\123'..'\126']
+    "alpha"  -> ['A'..'Z']++['a'..'z']
+    "graph"  -> ['\41'..'\126']
+    "space"  -> "\t\n\v\f\r "
+    "blank"  -> "\t "
+    "lower"  -> ['a'..'z']
+    "upper"  -> ['A'..'Z']
+    "cntrl"  -> ['\0'..'\31']++"\127" -- with NUL
+    "print"  -> ['\32'..'\126']
+    "xdigit" -> ['0'..'9']++['A'..'F']++['a'..'f']
+    "word"   -> ['0'..'9']++['A'..'Z']++"_"++['a'..'z']
+    _ -> []
+
 -- == -- == -- == -- == -- == -- == -- == -- == -- == -- == -- == -- == -- == 
-- == -- == -- == -- == -- ==
 
 -- | Do the transformation and simplification in a single traversal.
--- This removes the PPlus, PQuest, and PBound values, changing to POr
--- and PEmpty and PStar True\/False.  For some PBound values it adds
--- PNonEmpty and PNonCapture semantic marker.  It also simplifies to
--- flatten out nested POr and PConcat instances and eliminate some
--- unneeded PEmpty values.
+-- This removes the 'PPlus', 'PQuest', and 'PBound' values, changing to 'POr'
+-- and 'PEmpty' and 'PStar'.  For some 'PBound' values it adds
+-- 'PNonEmpty' and 'PNonCapture' semantic marker.  It also simplifies to
+-- flatten out nested 'POr' and 'PConcat' instances and eliminate some
+-- unneeded 'PEmpty' values.
 starTrans :: Pattern -> Pattern
 starTrans = dfsPattern (simplify' . starTrans')
 
--- | Apply a Pattern transformation function depth first
-dfsPattern :: (Pattern -> Pattern)  -- ^ The transformation function
-           -> Pattern               -- ^ The Pattern to transform
-           -> Pattern               -- ^ The transformed Pattern
+-- | Apply a 'Pattern' transformation function depth first.
+dfsPattern :: (Pattern -> Pattern)  -- ^ The transformation function.
+           -> Pattern               -- ^ The 'Pattern' to transform.
+           -> Pattern               -- ^ The transformed 'Pattern'.
 dfsPattern f = dfs
  where unary c = f . c . dfs
        dfs pattern = case pattern of
@@ -323,7 +404,7 @@
     pass = pIn
 
 -- | Function to transform a pattern into an equivalent, but less
--- redundant form.  Nested 'POr' and 'PConcat' are flattened. PEmpty
+-- redundant form.  Nested 'POr' and 'PConcat' are flattened. 'PEmpty'
 -- is propagated.
 simplify' :: Pattern -> Pattern
 simplify' x@(POr _) =
@@ -345,7 +426,7 @@
 --simplify' (PNonEmpty PEmpty) = err "simplify' (PNonEmpty PEmpty) = should be 
Impossible!" -- 2009
 simplify' other = other
 
--- | Function to flatten nested POr or nested PConcat applicataions.
+-- | Function to flatten nested 'POr' or nested 'PConcat' applicataions.
 flatten :: Pattern -> [Pattern]
 flatten (POr ps) = (concatMap (\x -> case x of
                                        POr ps' -> ps'
@@ -359,8 +440,8 @@
 notPEmpty PEmpty = False
 notPEmpty _      = True
 
--- | Determines if pIn will fail or accept [] and never accept any
--- characters. Treat PCarat and PDollar as True.
+-- | Determines if 'Pattern' will fail or accept @[]@ and never accept any
+-- characters. Treat 'PCarat' and 'PDollar' as @True@.
 canOnlyMatchNull :: Pattern -> Bool
 canOnlyMatchNull pIn =
   case pIn of
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/regex-tdfa-1.3.1.3/lib/Text/Regex/TDFA/ReadRegex.hs 
new/regex-tdfa-1.3.2/lib/Text/Regex/TDFA/ReadRegex.hs
--- old/regex-tdfa-1.3.1.3/lib/Text/Regex/TDFA/ReadRegex.hs     2001-09-09 
03:46:40.000000000 +0200
+++ new/regex-tdfa-1.3.2/lib/Text/Regex/TDFA/ReadRegex.hs       2001-09-09 
03:46:40.000000000 +0200
@@ -1,24 +1,32 @@
-{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
 -- | This is a POSIX version of parseRegex that allows NUL characters.
 -- Lazy\/Possessive\/Backrefs are not recognized.  Anchors \^ and \$ are
 -- recognized.
 --
--- The PGroup returned always have (Maybe GroupIndex) set to (Just _)
--- and never to Nothing.
+-- A 'PGroup' returned always has @(Maybe 'GroupIndex')@ set to @(Just _)@
+-- and never to @Nothing@.
+
 module Text.Regex.TDFA.ReadRegex (parseRegex) where
 
 {- By Chris Kuklewicz, 2007. BSD License, see the LICENSE file. -}
 
 import Text.Regex.TDFA.Pattern {- all -}
 import Text.ParserCombinators.Parsec((<|>), (<?>),
-  unexpected, try, runParser, many, getState, setState, CharParser, ParseError,
+  try, runParser, many, getState, setState, CharParser, ParseError,
   sepBy1, option, notFollowedBy, many1, lookAhead, eof, between,
   string, noneOf, digit, char, anyChar)
-import Control.Monad(liftM, when, guard)
+
+import Control.Monad (liftM, guard)
+
+import Data.Foldable (asum)
 import qualified Data.Set as Set(fromList)
 
--- | BracketElement is internal to this module
-data BracketElement = BEChar Char | BEChars String | BEColl String | BEEquiv 
String | BEClass String
+-- | An element inside @[...]@, denoting a character class.
+data BracketElement
+  = BEChar  Char       -- ^ A single character.
+  | BERange Char Char  -- ^ A character range (e.g. @a-z@).
+  | BEColl  String     -- ^ @foo@ in @[.foo.]@.
+  | BEEquiv String     -- ^ @bar@ in @[=bar=]@.
+  | BEClass String     -- ^ A POSIX character class (candidate), e.g. @alpha@ 
parsed from @[:alpha:]@.
 
 -- | Return either an error message or a tuple of the Pattern and the
 -- largest group index and the largest DoPa index (both have smallest
@@ -30,37 +38,46 @@
                              (lastGroupIndex,lastDopa) <- getState
                              return (pat,(lastGroupIndex,DoPa lastDopa))) 
(0,0) x x
 
-p_regex :: CharParser (GroupIndex,Int) Pattern
+type P = CharParser (GroupIndex, Int)
+
+p_regex :: P Pattern
 p_regex = liftM POr $ sepBy1 p_branch (char '|')
 
 -- man re_format helps a lot, it says one-or-more pieces so this is
 -- many1 not many.  Use "()" to indicate an empty piece.
+p_branch :: P Pattern
 p_branch = liftM PConcat $ many1 p_piece
 
+p_piece :: P Pattern
 p_piece = (p_anchor <|> p_atom) >>= p_post_atom -- correct specification
 
+p_atom :: P Pattern
 p_atom =  p_group <|> p_bracket <|> p_char <?> "an atom"
 
-group_index :: CharParser (GroupIndex,Int) (Maybe GroupIndex)
+group_index :: P (Maybe GroupIndex)
 group_index = do
   (gi,ci) <- getState
   let index = succ gi
   setState (index,ci)
   return (Just index)
 
+p_group :: P Pattern
 p_group = lookAhead (char '(') >> do
   index <- group_index
   liftM (PGroup index) $ between (char '(') (char ')') p_regex
 
 -- p_post_atom takes the previous atom as a parameter
+p_post_atom :: Pattern -> P Pattern
 p_post_atom atom = (char '?' >> return (PQuest atom))
                <|> (char '+' >> return (PPlus atom))
                <|> (char '*' >> return (PStar True atom))
                <|> p_bound atom
                <|> return atom
 
+p_bound :: Pattern -> P Pattern
 p_bound atom = try $ between (char '{') (char '}') (p_bound_spec atom)
 
+p_bound_spec :: Pattern -> P Pattern
 p_bound_spec atom = do lowS <- many1 digit
                        let lowI = read lowS
                        highMI <- option (Just lowI) $ try $ do
@@ -76,6 +93,7 @@
                        return (PBound lowI highMI atom)
 
 -- An anchor cannot be modified by a repetition specifier
+p_anchor :: P Pattern
 p_anchor = (char '^' >> liftM PCarat char_index)
        <|> (char '$' >> liftM PDollar char_index)
        <|> try (do _ <- string "()"
@@ -83,11 +101,13 @@
                    return $ PGroup index PEmpty)
        <?> "empty () or anchor ^ or $"
 
+char_index :: P DoPa
 char_index = do (gi,ci) <- getState
                 let ci' = succ ci
                 setState (gi,ci')
                 return (DoPa ci')
 
+p_char :: P Pattern
 p_char = p_dot <|> p_left_brace <|> p_escaped <|> p_other_char where
   p_dot = char '.' >> char_index >>= return . PDot
   p_left_brace = try $ (char '{' >> notFollowedBy digit >> char_index >>= 
return . (`PChar` '{'))
@@ -96,16 +116,18 @@
     where specials  = "^.[$()|*+?{\\"
 
 -- parse [bar] and [^bar] sets of characters
+p_bracket :: P Pattern
 p_bracket = (char '[') >> ( (char '^' >> p_set True) <|> (p_set False) )
 
--- p_set :: Bool -> GenParser Char st Pattern
-p_set invert = do initial <- (option "" ((char ']' >> return "]") <|> (char 
'-' >> return "-")))
+p_set :: Bool -> P Pattern
+p_set invert = do initial <- option "" (char ']' >> return "]")
                   values <- if null initial then many1 p_set_elem else many 
p_set_elem
                   _ <- char ']'
                   ci <- char_index
-                  let chars = maybe'set $ initial
-                                          ++ [c | BEChar c <- values ]
-                                          ++ concat [s | BEChars s <- values ]
+                  let chars = maybe'set $ concat $
+                        initial :
+                        [ c | BEChar c <- values ] :
+                        [ [start..end] | BERange start end <- values ]
                       colls = maybe'set [PatternSetCollatingElement coll | 
BEColl coll <- values ]
                       equivs = maybe'set [PatternSetEquivalenceClass equiv | 
BEEquiv equiv <- values]
                       class's = maybe'set [PatternSetCharacterClass a'class | 
BEClass a'class <- values]
@@ -115,31 +137,57 @@
 
 -- From here down the code is the parser and functions for pattern [ ] set 
things
 
-p_set_elem = p_set_elem_class <|> p_set_elem_equiv <|> p_set_elem_coll
-         <|> p_set_elem_range <|> p_set_elem_char <?> "Failed to parse 
bracketed string"
+p_set_elem :: P BracketElement
+p_set_elem = checkBracketElement =<< asum
+  [ p_set_elem_class
+  , p_set_elem_equiv
+  , p_set_elem_coll
+  , p_set_elem_range
+  , p_set_elem_char
+  , fail "Failed to parse bracketed string"
+  ]
 
+p_set_elem_class :: P BracketElement
 p_set_elem_class = liftM BEClass $
   try (between (string "[:") (string ":]") (many1 $ noneOf ":]"))
 
+p_set_elem_equiv :: P BracketElement
 p_set_elem_equiv = liftM BEEquiv $
   try (between (string "[=") (string "=]") (many1 $ noneOf "=]"))
 
+p_set_elem_coll :: P BracketElement
 p_set_elem_coll =  liftM BEColl $
   try (between (string "[.") (string ".]") (many1 $ noneOf ".]"))
 
+p_set_elem_range :: P BracketElement
 p_set_elem_range = try $ do
-  start <- noneOf "]-"
+  start <- noneOf "]"
   _  <- char '-'
   end <- noneOf "]"
-  -- bug fix: check start <= end before "return (BEChars [start..end])"
-  if start <= end
-    then return (BEChars [start..end])
-    else unexpected "End point of dashed character range is less than starting 
point"
+  return $ BERange start end
 
+p_set_elem_char :: P BracketElement
 p_set_elem_char = do
   c <- noneOf "]"
-  when (c == '-') $ do
-    atEnd <- (lookAhead (char ']') >> return True) <|> (return False)
-    when (not atEnd) (unexpected "A dash is in the wrong place in a bracket")
   return (BEChar c)
 
+-- | Fail when 'BracketElement' is invalid, e.g. empty range @1-0@.
+-- This failure should not be caught.
+--
+checkBracketElement :: BracketElement -> P BracketElement
+checkBracketElement e =
+  case e of
+    BERange start end
+      | start > end -> fail $ unwords
+          [ "End point"
+          , show end
+          , "of dashed character range is less than starting point"
+          , show start
+          ]
+      | otherwise -> ok
+    BEChar  _ -> ok
+    BEClass _ -> ok
+    BEColl  _ -> ok
+    BEEquiv _ -> ok
+  where
+    ok = return e
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/regex-tdfa-1.3.1.3/lib/Text/Regex/TDFA/TNFA.hs 
new/regex-tdfa-1.3.2/lib/Text/Regex/TDFA/TNFA.hs
--- old/regex-tdfa-1.3.1.3/lib/Text/Regex/TDFA/TNFA.hs  2001-09-09 
03:46:40.000000000 +0200
+++ new/regex-tdfa-1.3.2/lib/Text/Regex/TDFA/TNFA.hs    2001-09-09 
03:46:40.000000000 +0200
@@ -29,8 +29,10 @@
 --
 -- Uses recursive do notation.
 
-module Text.Regex.TDFA.TNFA(patternToNFA
-                            ,QNFA(..),QT(..),QTrans,TagUpdate(..)) where
+module Text.Regex.TDFA.TNFA
+  ( patternToNFA
+  , QNFA(..), QT(..), QTrans, TagUpdate(..)
+  ) where
 
 {- By Chris Kuklewicz, 2007. BSD License, see the LICENSE file. -}
 
@@ -48,7 +50,7 @@
 import qualified Data.IntSet.EnumSet2 as Set(singleton,toList,insert)
 import Data.Maybe(catMaybes,isNothing)
 import Data.Monoid as Mon(Monoid(..))
-import qualified Data.Set as S(Set,insert,toAscList,empty)
+import qualified Data.Set as S (insert, toAscList)
 
 import 
Text.Regex.TDFA.Common(QT(..),QNFA(..),QTrans,TagTask(..),TagUpdate(..),DoPa(..)
                              ,CompOption(..)
@@ -57,8 +59,7 @@
 import 
Text.Regex.TDFA.CorePattern(Q(..),P(..),OP(..),WhichTest,cleanNullView,NullView
                                   ,SetTestInfo(..),Wanted(..),TestInfo
                                   ,mustAccept,cannotAccept,patternToQ)
-import 
Text.Regex.TDFA.Pattern(Pattern(..),PatternSet(..),unSEC,PatternSetCharacterClass(..))
---import Debug.Trace
+import Text.Regex.TDFA.Pattern (Pattern(..), decodePatternSet)
 
 ecart :: String -> a -> a
 ecart _ = id
@@ -785,42 +786,3 @@
 ADD ORPHAN ID check and make this a fatal error while testing
 
 -}
-
--- | decodePatternSet cannot handle collating element and treats
--- equivalence classes as just their definition and nothing more.
-decodePatternSet :: PatternSet -> S.Set Char
-decodePatternSet (PatternSet msc mscc _ msec) =
-  let baseMSC = maybe S.empty id msc
-      withMSCC = foldl (flip S.insert) baseMSC  (maybe [] (concatMap 
decodeCharacterClass . S.toAscList) mscc)
-      withMSEC = foldl (flip S.insert) withMSCC (maybe [] (concatMap unSEC . 
S.toAscList) msec)
-  in withMSEC
-
--- | This returns the distinct ascending list of characters
--- represented by [: :] values in legalCharacterClasses; unrecognized
--- class names return an empty string
-decodeCharacterClass :: PatternSetCharacterClass -> String
-decodeCharacterClass (PatternSetCharacterClass s) =
-  case s of
-    "alnum" -> ['0'..'9']++['a'..'z']++['A'..'Z']
-    "digit" -> ['0'..'9']
-    "punct" -> 
['\33'..'\47']++['\58'..'\64']++['\91'..'\95']++"\96"++['\123'..'\126']
-    "alpha" -> ['a'..'z']++['A'..'Z']
-    "graph" -> ['\41'..'\126']
-    "space" -> "\t\n\v\f\r "
-    "blank" -> "\t "
-    "lower" -> ['a'..'z']
-    "upper" -> ['A'..'Z']
-    "cntrl" -> ['\0'..'\31']++"\127" -- with NUL
-    "print" -> ['\32'..'\126']
-    "xdigit" -> ['0'..'9']++['a'..'f']++['A'..'F']
-    "word" -> ['0'..'9']++['a'..'z']++['A'..'Z']++"_"
-    _ -> []
-
-{-
--- | This is the list of recognized [: :] character classes, others
--- are decoded as empty.
-legalCharacterClasses :: [String]
-legalCharacterClasses = ["alnum","digit","punct","alpha","graph"
-  ,"space","blank","lower","upper","cntrl","print","xdigit","word"]
-
--}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/regex-tdfa-1.3.1.3/lib/Text/Regex/TDFA.hs 
new/regex-tdfa-1.3.2/lib/Text/Regex/TDFA.hs
--- old/regex-tdfa-1.3.1.3/lib/Text/Regex/TDFA.hs       2001-09-09 
03:46:40.000000000 +0200
+++ new/regex-tdfa-1.3.2/lib/Text/Regex/TDFA.hs 2001-09-09 03:46:40.000000000 
+0200
@@ -21,7 +21,7 @@
 
 Declare a dependency on the @regex-tdfa@ library in your @.cabal@ file:
 
-> build-depends: regex-tdfa ^>= 1.3.1.1
+> build-depends: regex-tdfa ^>= 1.3.2
 
 In Haskell modules where you want to use regexes simply @import@ /this/ module:
 
@@ -32,9 +32,18 @@
 = Basics
 
 @
-??> let emailRegex = "[a-zA-Z0-9+.\_-]+\@[a-zA-Z-]+\\\\.[a-z]+"
-??> "my email is [email protected]" '=~' emailRegex :: Bool
->>> True
+>>> let emailRegex = "[a-zA-Z0-9+._-]+\\@[-a-zA-Z]+\\.[a-z]+"
+>>> "my email is [email protected]" =~ emailRegex :: Bool
+True
+
+>>> "invalid@mail@com" =~ emailRegex :: Bool
+False
+
+>>> "[email protected]" =~ emailRegex :: Bool
+False
+
+>>> "#@invalid.com" =~ emailRegex :: Bool
+False
 
 /-- non-monadic/
 ??> \<to-match-against\> '=~' \<regex\>
@@ -61,11 +70,12 @@
 /-- returns empty string if no match/
 a '=~' b :: String  /-- or ByteString, or Text.../
 
-??> "alexis-de-tocqueville" '=~' "[a-z]+" :: String
->>> "alexis"
+>>> "alexis-de-tocqueville" =~ "[a-z]+" :: String
+"alexis"
+
+>>> "alexis-de-tocqueville" =~ "[0-9]+" :: String
+""
 
-??> "alexis-de-tocqueville" '=~' "[0-9]+" :: String
->>> ""
 @
 
 == Check if it matched at all
@@ -73,8 +83,9 @@
 @
 a '=~' b :: Bool
 
-??> "alexis-de-tocqueville" '=~' "[a-z]+" :: Bool
->>> True
+>>> "alexis-de-tocqueville" =~ "[a-z]+" :: Bool
+True
+
 @
 
 == Get first match + text before/after
@@ -84,11 +95,12 @@
 /-- 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" =~ "de" :: (String, String, String)
+("alexis-","de","-tocqueville")
+
+>>> "alexis-de-tocqueville" =~ "kant" :: (String, String, String)
+("alexis-de-tocqueville","","")
 
-??> "alexis-de-tocqueville" '=~' "kant" :: (String, String, String)
->>> ("alexis-de-tocqueville", "", "")
 @
 
 == Get first match + submatches
@@ -98,8 +110,9 @@
 /-- 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"])
+>>> "div[attr=1234]" =~ "div\\[([a-z]+)=([^]]+)\\]" :: (String, String, 
String, [String])
+("","div[attr=1234]","",["attr","1234"])
+
 @
 
 == Get /all/ matches
@@ -108,8 +121,12 @@
 /-- can also return Data.Array instead of List/
 'getAllTextMatches' (a '=~' b) :: [String]
 
-??> 'getAllTextMatches' ("john anne yifan" '=~' "[a-z]+") :: [String]
->>> ["john","anne","yifan"]
+>>> getAllTextMatches ("john anne yifan" =~ "[a-z]+") :: [String]
+["john","anne","yifan"]
+
+>>> getAllTextMatches ("* - . a + z" =~ "[--z]+") :: [String]
+["-",".","a","z"]
+
 @
 
 = Feature support
@@ -143,6 +160,12 @@
 ASCII only, valid classes are alnum, digit, punct, alpha, graph,
 space, blank, lower, upper, cntrl, print, xdigit, word.
 
+@
+>>> getAllTextMatches ("john anne yifan" =~ "[[:lower:]]+") :: [String]
+["john","anne","yifan"]
+
+@
+
 This package does not provide "basic" regular expressions.  This
 package does not provide back references inside regular expressions.
 
@@ -165,7 +188,7 @@
 import Text.Regex.TDFA
 
 ??> "2 * (3 + 1) / 4" '=~' [r|\\([^)]+\\)|] :: String
->>> "(3 + 1)"
+"(3 + 1)"
 @
 
 -}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/regex-tdfa-1.3.1.3/regex-tdfa.cabal 
new/regex-tdfa-1.3.2/regex-tdfa.cabal
--- old/regex-tdfa-1.3.1.3/regex-tdfa.cabal     2001-09-09 03:46:40.000000000 
+0200
+++ new/regex-tdfa-1.3.2/regex-tdfa.cabal       2001-09-09 03:46:40.000000000 
+0200
@@ -1,6 +1,6 @@
 cabal-version:          1.12
 name:                   regex-tdfa
-version:                1.3.1.3
+version:                1.3.2
 
 build-Type:             Simple
 license:                BSD3
@@ -46,7 +46,7 @@
 source-repository this
   type:                git
   location:            https://github.com/haskell-hvr/regex-tdfa.git
-  tag:                 v1.3.1.3
+  tag:                 v1.3.2
 
 flag force-O2
   default: False
@@ -173,3 +173,16 @@
 
   if flag(force-O2)
     ghc-options:        -O2
+
+test-suite doc-test
+  type:           exitcode-stdio-1.0
+  hs-source-dirs: test
+  main-is:        DocTestMain.hs
+
+  build-depends:
+      base
+    , regex-tdfa
+    , doctest-parallel >= 0.2.2
+        -- doctest-parallel-0.2.2 is the first to filter out autogen-modules
+
+  default-language:     Haskell2010
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/regex-tdfa-1.3.1.3/test/DocTestMain.hs 
new/regex-tdfa-1.3.2/test/DocTestMain.hs
--- old/regex-tdfa-1.3.1.3/test/DocTestMain.hs  1970-01-01 01:00:00.000000000 
+0100
+++ new/regex-tdfa-1.3.2/test/DocTestMain.hs    2001-09-09 03:46:40.000000000 
+0200
@@ -0,0 +1,16 @@
+module Main where
+
+import System.Environment
+         ( getArgs )
+import Test.DocTest
+         ( mainFromLibrary )
+import Test.DocTest.Helpers
+         ( extractSpecificCabalLibrary, findCabalPackage )
+
+main :: IO ()
+main = do
+  args <- getArgs
+  pkg  <- findCabalPackage "regex-tdfa"
+  -- Need to give the library name, otherwise the parser does not find it.
+  lib  <- extractSpecificCabalLibrary Nothing pkg
+  mainFromLibrary lib args

Reply via email to