Permalink
Browse files

1.0.0.0: First stable release

  * Rewrite tutorials (fixes #113)
  * Add Text.RE.Tools.IsRegex (fixes #122)
  * Include Macro Parsers in Core API (fixes #123)
  * Adjust type of lookupCaptureID and friends (fixes #124)
  * re-prep to handle cast example expressions (fixes #125)
  * Rename compileSearchReplaceWithOptions (fixes #126)
  * Hide ZeInternals, Evacuate Text.RE (fixes #127)
  * Proper Haddocks for the quasi quoters (fixes #128)
  * ed_ quasi quoters are being restricted to SimpleREOptions (fixes #129)
  * regex dependeny on pcre-builtin (fixes #130)
  • Loading branch information...
cdornan committed Apr 15, 2017
1 parent 29c1e88 commit 0fe2f2f9713c1dece46da283c9587ef96313acd6
Showing with 3,968 additions and 2,399 deletions.
  1. +2 −2 README.md
  2. +1 −39 Text/RE.hs
  3. +86 −25 Text/RE/PCRE.hs
  4. +60 −16 Text/RE/PCRE/ByteString.hs
  5. +60 −16 Text/RE/PCRE/ByteString/Lazy.hs
  6. +60 −16 Text/RE/PCRE/Sequence.hs
  7. +60 −16 Text/RE/PCRE/String.hs
  8. +16 −3 Text/RE/REOptions.lhs
  9. +20 −9 Text/RE/Replace.hs
  10. +4 −4 Text/RE/Summa.hs
  11. +105 −21 Text/RE/TDFA.hs
  12. +60 −16 Text/RE/TDFA/ByteString.hs
  13. +60 −16 Text/RE/TDFA/ByteString/Lazy.hs
  14. +60 −16 Text/RE/TDFA/Sequence.hs
  15. +60 −16 Text/RE/TDFA/String.hs
  16. +60 −16 Text/RE/TDFA/Text.hs
  17. +60 −16 Text/RE/TDFA/Text/Lazy.hs
  18. +16 −24 Text/RE/TestBench.hs
  19. +23 −0 Text/RE/TestBench/Parsers.hs
  20. +16 −5 Text/RE/Tools.hs
  21. +29 −10 Text/RE/Tools/Edit.lhs
  22. +24 −4 Text/RE/Tools/Find.lhs
  23. +30 −5 Text/RE/Tools/Grep.lhs
  24. +17 −0 Text/RE/Tools/IsRegex.hs
  25. +17 −4 Text/RE/Tools/Lex.hs
  26. +33 −10 Text/RE/Tools/Sed.lhs
  27. +51 −8 Text/RE/ZeInternals.hs
  28. +6 −4 Text/RE/ZeInternals/NamedCaptures.lhs
  29. +68 −37 Text/RE/ZeInternals/PCRE.hs
  30. +2 −2 Text/RE/ZeInternals/PreludeMacros.hs
  31. +48 −36 Text/RE/ZeInternals/SearchReplace/PCRE/ByteString.hs
  32. +48 −36 Text/RE/ZeInternals/SearchReplace/PCRE/ByteString/Lazy.hs
  33. +48 −36 Text/RE/ZeInternals/SearchReplace/PCRE/Sequence.hs
  34. +48 −36 Text/RE/ZeInternals/SearchReplace/PCRE/String.hs
  35. +2 −3 Text/RE/ZeInternals/SearchReplace/PCREEdPrime.hs
  36. +48 −36 Text/RE/ZeInternals/SearchReplace/TDFA/ByteString.hs
  37. +48 −36 Text/RE/ZeInternals/SearchReplace/TDFA/ByteString/Lazy.hs
  38. +48 −36 Text/RE/ZeInternals/SearchReplace/TDFA/Sequence.hs
  39. +48 −36 Text/RE/ZeInternals/SearchReplace/TDFA/String.hs
  40. +48 −36 Text/RE/ZeInternals/SearchReplace/TDFA/Text.hs
  41. +48 −36 Text/RE/ZeInternals/SearchReplace/TDFA/Text/Lazy.hs
  42. +2 −3 Text/RE/ZeInternals/SearchReplace/TDFAEdPrime.hs
  43. +55 −44 Text/RE/ZeInternals/TDFA.hs
  44. +2 −0 Text/RE/ZeInternals/Tools/Lex.lhs
  45. +3 −7 Text/RE/ZeInternals/Types/CaptureID.hs
  46. +2 −0 Text/RE/ZeInternals/Types/IsRegex.lhs
  47. +8 −10 Text/RE/ZeInternals/Types/Match.lhs
  48. +3 −3 Text/RE/ZeInternals/Types/Matches.lhs
  49. +0 −15 Text/RE/ZeInternals/Types/SearchReplace.hs
  50. +23 −0 Text/RE/ZeInternals/Types/SearchReplace.lhs
  51. +13 −1 changelog
  52. +5 −12 data/include-result.lhs
  53. +2 −2 data/pcre-macros.txt
  54. +2 −2 data/pcre-nginx-log-processor.txt
  55. +6 −13 data/pp-result-doc.lhs
  56. +5 −9 data/pp-result-gen.lhs
  57. +4 −9 data/pp-test.lhs
  58. +2 −2 data/tdfa-macros.txt
  59. +30 −3 examples/TestKit.lhs
  60. +0 −2 examples/re-include.lhs
  61. +8 −5 examples/re-nginx-log-processor.lhs
  62. +43 −24 examples/re-prep.lhs
  63. +2 −1 examples/re-sort-imports.lhs
  64. +8 −7 examples/re-tests.lhs
  65. +148 −658 examples/re-tutorial-master.lhs
  66. +207 −5 examples/re-tutorial-options-master.lhs
  67. +221 −6 examples/re-tutorial-options.lhs
  68. +198 −5 examples/re-tutorial-replacing-master.lhs
  69. +211 −6 examples/re-tutorial-replacing.lhs
  70. +142 −5 examples/re-tutorial-testbench-master.lhs
  71. +154 −6 examples/re-tutorial-testbench.lhs
  72. +192 −5 examples/re-tutorial-tools-master.lhs
  73. +204 −6 examples/re-tutorial-tools.lhs
  74. +154 −667 examples/re-tutorial.lhs
  75. +2 −2 lib/README-regex-examples.md
  76. +2 −2 lib/README-regex.md
  77. +1 −1 lib/cabal-masters/executables-incl.cabal
  78. +4 −2 lib/cabal-masters/library-incl.cabal
  79. +2 −0 lib/cabal-masters/mega-regex.cabal
  80. +2 −1 lib/cabal-masters/regex-with-pcre.cabal
  81. +3 −0 lib/cabal-masters/regex.cabal
  82. +1 −0 lib/cabal-masters/test-extra-source-files-incl.cabal
  83. +5 −0 lib/md/directory.md
  84. +1 −1 lib/md/roadmap-incl.md
  85. +1 −1 lib/md/summary-incl.md
  86. +10 −11 lib/md/tutorial.md
  87. +33 −28 lib/mega-regex.cabal
  88. +34 −31 lib/regex-examples.cabal
  89. +5 −4 lib/regex-with-pcre.cabal
  90. +7 −3 lib/regex.cabal
  91. +1 −1 lib/version.txt
  92. +53 −0 pp-result-doc.lhs
  93. +60 −0 pp-result-gen.lhs
  94. +33 −28 regex.cabal
  95. BIN releases/regex-1.0.0.0.tar.gz
  96. BIN releases/regex-examples-1.0.0.0.tar.gz
  97. BIN releases/regex-with-pcre-1.0.0.0.tar.gz
  98. +1 −1 save/index.md
View
@@ -12,7 +12,7 @@ regex is a regular expression toolkit for regex-base with:
* regular expression macros including:
+ a number of useful RE macros;
+ a test bench for testing and documenting new macro environments;
- * built-in support for the TDFA and PCRE backends;
+ * built-in support for the TDFA and PCRE back ends;
* comprehensive documentation, tutorials and copious examples.
@@ -56,7 +56,7 @@ two packages:
- [X] 2017-03-31 v0.12.0.0 [Move IsRegex into Text.RE](https://github.com/iconnect/regex/milestone/16)
- [X] 2017-04-03 v0.13.0.0 [Protect findCaptureID and add Find, re-sort-imports](https://github.com/iconnect/regex/milestone/17)
- [X] 2017-04-04 v0.14.0.0 [Move IsOption, rename Find functions](https://github.com/iconnect/regex/milestone/18)
-- [ ] 2017-04-10 v1.0.0.0 [First stable release](https://github.com/iconnect/regex/milestone/3)
+- [X] 2017-04-10 v1.0.0.0 [First stable release](https://github.com/iconnect/regex/milestone/3)
- [ ] 2017-08-31 v2.0.0.0 [Fast text replacement with benchmarks](https://github.com/iconnect/regex/milestone/4)
View
@@ -17,36 +17,8 @@ module Text.RE
-- * Further Use
-- $further
-
- -- * The regex Foundational Types
- -- ** Matches
- Matches
- , matchesSource
- , allMatches
- , anyMatches
- , countMatches
- , matches
- -- ** Match
- , Match
- , matchSource
- , matched
- , matchedText
-
- -- * IsRegex
- -- $isregex
- , IsRegex(..)
- , searchReplaceAll
- , searchReplaceFirst
- -- * IsRegex Instances
- -- $instances
- , module Text.RE.TDFA
) where
-import Text.RE.TDFA()
-import Text.RE.ZeInternals.Types.IsRegex
-import Text.RE.ZeInternals.Types.Match
-import Text.RE.ZeInternals.Types.Matches
-
-- $tutorial
--
-- We have a regex tutorial at <http://tutorial.regex.uk>.
@@ -91,17 +63,7 @@ import Text.RE.ZeInternals.Types.Matches
-- For more specialist applications we have the following:
--
-- * "Text.RE.REOptions" for specifying back-end specific options;
--- * "Text.RE.Replace" for the full replace toolkit;
+-- * "Text.RE.Replace" for the full text-replacement toolkit;
-- * "Text.RE.TestBench" for building up, testing and doumenting;
-- macro environments for use in REs;
-- * "Text.RE.Tools" for an AWK-like text-processing toolkit.
-
--- $isregex
--- Class @IsRegex re t@ provides methods for matching the @t@ type for
--- the @re@ back end as well as compiling REs from @t@ to @re@ and
--- getting the source @t@ back again. The 'Replace' superclass of
--- @IsRegex@ contains a useful toolkit for converting between @t@ and
--- 'String' abd @Text@.
-
--- $instances
--- This module import just imports the @IsRegex TDFA s@ instances.
View
@@ -14,70 +14,114 @@ module Text.RE.PCRE
-- * About this Module
-- $about
- -- * The Match Operators
+ -- * The 'Matches' and 'Match' Operators
(*=~)
, (?=~)
- -- * The SearchReplace Operators
+ -- * The 'SearchReplace' Operators
, (*=~/)
, (?=~/)
- -- * Matches
+ -- * The 'Matches' Type
, Matches
, matchesSource
, allMatches
, anyMatches
, countMatches
, matches
- -- * Match
+ -- * The 'Match' Type
, Match
, matchSource
, matched
, matchedText
+ -- * The Macros and Parsers
+ -- $macros
+ , module Text.RE.TestBench.Parsers
-- * The 'RE' Type
, RE
+ , regexType
+ , reOptions
, reSource
+ , reCaptureNames
+ , reRegex
-- * Options
-- $options
, SimpleREOptions(..)
+ , IsOption(..)
+ , REOptions
+ , defaultREOptions
+ , noPreludeREOptions
+ , unpackSimpleREOptions
-- * Compiling and Escaping REs
, SearchReplace(..)
, compileRegex
, compileRegexWith
+ , compileRegexWithOptions
, compileSearchReplace
, compileSearchReplaceWith
+ , compileSearchReplaceWithOptions
, escape
, escapeWith
+ , escapeWithOptions
, escapeREString
- -- * The Classic rexex-base Match Operators
+ -- * The Classic regex-base Match Operators
, (=~)
, (=~~)
- -- * IsRegex
- , IsRegex(..)
- -- * The Quasi Quoters and Minor Functions
+ -- * The re Quasi Quoters
-- $re
- , module Text.RE.ZeInternals.PCRE
+ , re
+ , reMultilineSensitive
+ , reMultilineInsensitive
+ , reBlockSensitive
+ , reBlockInsensitive
+ , reMS
+ , reMI
+ , reBS
+ , reBI
+ , re_
+ -- * The Ed Quasi Quoters
-- $ed
- , module Text.RE.ZeInternals.SearchReplace.PCRE
- -- * The Operator Instances
+ , ed
+ , edMultilineSensitive
+ , edMultilineInsensitive
+ , edBlockSensitive
+ , edBlockInsensitive
+ , edMS
+ , edMI
+ , edBS
+ , edBI
+ , ed_
+ -- * The cp Quasi Quoters
+ , cp
+ -- * RE Macros Standard Environment
+ -- $prelude
+ , prelude
+ , preludeEnv
+ , preludeTestsFailing
+ , preludeTable
+ , preludeSummary
+ , preludeSources
+ , preludeSource
+ -- * IsRegex
+ -- $isregex
+ , module Text.RE.Tools.IsRegex
+ -- * The IsRegex 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 Text.RE.PCRE.ByteString()
import Text.RE.PCRE.ByteString.Lazy()
import Text.RE.PCRE.Sequence()
import Text.RE.PCRE.String()
import Text.RE.REOptions
-import Text.RE.ZeInternals.AddCaptureNames
+import Text.RE.Replace
+import Text.RE.TestBench.Parsers
+import Text.RE.Tools.IsRegex
+import Text.RE.ZeInternals
import Text.RE.ZeInternals.PCRE
import Text.RE.ZeInternals.SearchReplace.PCRE
-import Text.RE.ZeInternals.Types.IsRegex
-import Text.RE.ZeInternals.Types.Match
-import Text.RE.ZeInternals.Types.Matches
import qualified Text.Regex.Base as B
import qualified Text.Regex.PCRE as PCRE
@@ -147,16 +191,21 @@ import qualified Text.Regex.PCRE as PCRE
-- $about
-- This module provides access to the back end through polymorphic functions
-- that operate over all of the String\/Text\/ByteString types supported by the
--- PCRE back end. If you don't need this generality you might find it easier
--- to work with one of the modules that have been specialised for each of these
--- types:
+-- back end. The module also provides all of the specialised back-end functionality
+-- that will not be needed by most regex clientts. If you don't need this generality
+-- then you might want to consider using one of the simpler modules that have been
+-- specialised for each of these types:
--
-- * "Text.RE.PCRE.ByteString"
-- * "Text.RE.PCRE.ByteString.Lazy"
--- * "Text.RE.ZeInternals.PCRE"
-- * "Text.RE.PCRE.Sequence"
-- * "Text.RE.PCRE.String"
+-- $macros
+-- There are a number of RE macros and corresponding Haskell parsers
+-- for parsing the matched text into appropriate Haskell types. See
+-- the [Macros Tables](http://regex.uk/macros) for details.
+
-- $options
-- You can specify different compilation options by appending a
-- to the name of an [re| ... |] or [ed| ... \/\/\/ ... |] quasi quoter
@@ -167,7 +216,7 @@ import qualified Text.Regex.PCRE as PCRE
--
-- will replace a @foo@ suffix of the argument text, of any
-- capitalisation, with a (lower case) @bar@. If you need to specify the
--- options dynamically, use the @[re_| ... |]@ and @[red_| ... \/\/\/ ... |]@
+-- options dynamically, use the @[re_| ... |]@ and @[ed_| ... \/\/\/ ... |]@
-- quasi quoters, which generate functions that take an 'IsOption' option
-- (e.g., a 'SimpleReOptions' value) and yields a 'RE' or 'SearchReplace'
-- as apropriate. For example if you have a 'SimpleReOptions' value in
@@ -184,8 +233,20 @@ import qualified Text.Regex.PCRE as PCRE
-- specialised back-end types and functions.
-- $ed
--- The @[ed|.*\/\/\/foo|]@ quasi quoters, with variants for specifing different
--- options to the RE compiler (see "Text.RE.REOptions").
+-- The -- | the @[ed| ... \/\/\/ ... |]@ quasi quoters; for example,
+--
+-- @[ed|${y}([0-9]{4})-0*${m}([0-9]{2})-0*${d}([0-9]{2})\/\/\/${d}\/${m}\/${y}|])@
+--
+-- represents a @SearchReplace@ that will convert a YYYY-MM-DD format date
+-- into a DD\/MM\/YYYY format date.
+--
+-- The only difference betweem these quasi quoters is the RE options that are set,
+-- using the same conventions as the @[re| ... |]@ quasi quoters.
+--
+
+-- $isregex
+-- The 'IsRegex' class is used to abstact over the different regex back ends and
+-- the text types they work with -- see "Text.RE.Tools.IsRegex" for details.
-- $instances
--- These modules merely provide the 'IsRegex' instances.
+-- These module exportss merely provide the 'IsRegex' instances.
Oops, something went wrong.

0 comments on commit 0fe2f2f

Please sign in to comment.