regex-examples 0.11.1.0 → 0.12.0.0
raw patch · 26 files changed
+193/−152 lines, 26 filesdep ~regexdep ~regex-with-pcre
Dependency ranges changed: regex, regex-with-pcre
Files
- README.markdown +11/−7
- changelog +4/−0
- examples/TestKit.lhs +18/−0
- examples/re-gen-cabals.lhs +1/−2
- examples/re-gen-modules.lhs +0/−1
- examples/re-include.lhs +1/−2
- examples/re-nginx-log-processor.lhs +2/−22
- examples/re-prep.lhs +3/−4
- examples/re-tests.lhs +1/−6
- examples/re-tutorial.lhs +1/−4
- lib/cabal-masters/executables-incl.cabal +1/−1
- lib/cabal-masters/library-incl.cabal +2/−1
- lib/cabal-masters/regex.cabal +3/−2
- lib/mega-regex.cabal +21/−18
- lib/version.txt +1/−1
- regex-examples.cabal +23/−21
- src/Text/RE/PCRE/ByteString.hs +10/−6
- src/Text/RE/PCRE/ByteString/Lazy.hs +10/−6
- src/Text/RE/PCRE/Sequence.hs +10/−6
- src/Text/RE/PCRE/String.hs +10/−6
- src/Text/RE/TDFA/ByteString.hs +10/−6
- src/Text/RE/TDFA/ByteString/Lazy.hs +10/−6
- src/Text/RE/TDFA/Sequence.hs +10/−6
- src/Text/RE/TDFA/String.hs +10/−6
- src/Text/RE/TDFA/Text.hs +10/−6
- src/Text/RE/TDFA/Text/Lazy.hs +10/−6
README.markdown view
@@ -2,18 +2,18 @@ regex is a regular expression toolkit for regex-base with: - * text-replacement operations with named captures;+ * a text-replacement toolkit with type-safe text-replacement templates; * special datatypes for matches and captures; * compile-time checking of RE syntax; * a unified means of controlling case-sensitivity and multi-line options; * high-level AWK-like tools for building text processing apps; * the option of using match operators with reduced polymorphism on the- text and/or result types;+ text and result types; * 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;- * comprehensive documentation and copious examples.+ * comprehensive documentation, tutorials and copious examples. See the [About page](http://about.regex.uk) for details.@@ -70,8 +70,12 @@ ☒ 2017-03-29 v0.11.0.0 [Simplify the API](https://github.com/iconnect/regex/milestone/14) - ☐ 2017-03-31 v1.0.0.0 [First stable release](https://github.com/iconnect/regex/milestone/3)+ ☒ 2017-03-30 v0.11.1.0 [Fix the Haddocks](https://github.com/iconnect/regex/milestone/15) + ☒ 2017-03-31 v0.12.0.0 [Move IsRegex into Text.RE](https://github.com/iconnect/regex/milestone/16)++ ☐ 2017-04-03 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) @@ -109,9 +113,9 @@ If you have any feedback or suggestion then please drop us a line. - `t` [@hregex](https://twitter.com/hregex)\n- `e` maintainers@regex.uk\n- `w` http://issues.regex.uk+ * `t` [@hregex](https://twitter.com/hregex)\n+ * `e` maintainers@regex.uk\n+ * `w` http://issues.regex.uk The [Contact page](http://contact.regex.uk) has more details.
changelog view
@@ -1,5 +1,9 @@ -*-change-log-*- +0.12.0.0 Chris Dornan <chris.dornan@irisconnect.co.uk> 2017-03-31+ * Add Text.RE.REOptions to RE.Summa (#103)+ * Move IsRegex into Text.RE (#104)+ 0.11.1.0 Chris Dornan <chris.dornan@irisconnect.co.uk> 2017-03-30 * Cannot hide Text.RE.ZeInternals.SearchReaplace modules (#101)
examples/TestKit.lhs view
@@ -23,6 +23,7 @@ , test_pp , include , cmp+ , dumpMacroTable ) where import Control.Applicative@@ -187,6 +188,7 @@ prs_s = maybe (error "include") T.unpack . parseString \end{code} + cmp --- @@ -202,4 +204,20 @@ hPutStrLn stderr $ "testing results against model answers failed: " ++ show se return False+\end{code}+++dumpMacroTable+--------------++\begin{code}+-- | dump a MacroEnv into the docs directory+dumpMacroTable :: FilePath+ -> FilePath+ -> RegexType+ -> MacroEnv+ -> IO ()+dumpMacroTable fp_t fp_s rty m_env = do+ writeFile fp_t $ formatMacroTable rty m_env+ writeFile fp_s $ formatMacroSources rty ExclCaptures m_env \end{code}
examples/re-gen-cabals.lhs view
@@ -37,12 +37,11 @@ import System.IO import TestKit import Text.Printf+import Text.RE.Replace import Text.RE.TDFA.ByteString.Lazy import Text.RE.TDFA.Text as T import Text.RE.Tools.Grep import Text.RE.Tools.Sed-import Text.RE.ZeInternals.Types.Match-import Text.RE.ZeInternals.Types.Matches main :: IO ()
examples/re-gen-modules.lhs view
@@ -27,7 +27,6 @@ import System.IO import Text.RE.TDFA.ByteString.Lazy import Text.RE.Tools.Sed-import Text.RE.ZeInternals.Types.SearchReplace type ModPath = String
examples/re-include.lhs view
@@ -31,13 +31,12 @@ import Prelude.Compat import System.Environment import TestKit+import Text.RE import Text.RE.Tools.Edit import Text.RE.TDFA.ByteString.Lazy import Text.RE.TestBench import Text.RE.Tools.Grep import Text.RE.Tools.Sed-import Text.RE.ZeInternals.Types.Capture-import Text.RE.ZeInternals.Types.Match import Text.RE.Replace \end{code}
examples/re-nginx-log-processor.lhs view
@@ -26,7 +26,6 @@ ) where import Control.Applicative-import Control.Exception import Control.Monad import qualified Data.ByteString.Lazy.Char8 as LBS import Data.Char@@ -37,19 +36,17 @@ import qualified Data.Text as T import Data.Time import Prelude.Compat-import qualified Shelly as SH import System.Directory import System.FilePath import System.Environment import System.Exit import System.IO+import TestKit+import Text.RE import Text.RE.PCRE.ByteString.Lazy import qualified Text.RE.PCRE.String as S import Text.RE.TestBench import Text.RE.Tools.Sed-import Text.RE.ZeInternals.TestBench-import Text.RE.ZeInternals.Types.Capture-import Text.RE.ZeInternals.Types.Match import Text.RE.REOptions import Text.RE.Replace import Text.Printf@@ -592,21 +589,4 @@ _ -> Nothing where p cs = matchCapture cs >>= parseInteger . capturedText-------- cmp-----cmp :: T.Text -> T.Text -> IO Bool-cmp src dst = handle hdl $ do- _ <- SH.shelly $ SH.verbosely $- SH.run "cmp" [src,dst]- return True- where- hdl :: SomeException -> IO Bool- hdl se = do- hPutStrLn stderr $- "testing results against model answers failed: " ++ show se- return False \end{code}
examples/re-prep.lhs view
@@ -37,13 +37,12 @@ import System.IO import TestKit import Text.Heredoc+import Text.RE import Text.RE.TestBench import Text.RE.Tools.Grep import Text.RE.Tools.Sed import Text.RE.TDFA.ByteString.Lazy import qualified Text.RE.TDFA.Text as TT-import Text.RE.ZeInternals.Types.Capture-import Text.RE.ZeInternals.Types.Match import Text.RE.Replace \end{code} @@ -175,15 +174,15 @@ pd "re-prep" pd "re-tests" pd "TestKit"- pd "RE/IsRegex" pd "RE/REOptions" pd "RE/Tools/Edit" pd "RE/Tools/Grep"- pd "RE/Tools/Lex" pd "RE/Tools/Sed"+ pd "RE/ZeInternals/Lex" pd "RE/ZeInternals/NamedCaptures" pd "RE/ZeInternals/Replace" pd "RE/ZeInternals/TestBench"+ pd "RE/ZeInternals/Types/IsRegex" pd "RE/ZeInternals/Types/Matches" pd "RE/ZeInternals/Types/Match" pd "RE/ZeInternals/Types/Capture"
examples/re-tests.lhs view
@@ -43,6 +43,7 @@ import System.Directory import System.FilePath import Test.SmallCheck.Series+import TestKit import Test.Tasty import Test.Tasty.HUnit import Test.Tasty.SmallCheck as SC@@ -51,7 +52,6 @@ import qualified Text.Regex.TDFA as TDFA_ import Text.RE import Text.RE.Replace-import Text.RE.IsRegex import qualified Text.RE.PCRE as PCRE import Text.RE.TDFA as TDFA import Text.RE.TestBench@@ -59,11 +59,6 @@ import Text.RE.ZeInternals.AddCaptureNames import Text.RE.ZeInternals.NamedCaptures import Text.RE.ZeInternals.PreludeMacros-import Text.RE.ZeInternals.TestBench-import Text.RE.ZeInternals.Types.Capture-import Text.RE.ZeInternals.Types.CaptureID-import Text.RE.ZeInternals.Types.Match-import Text.RE.ZeInternals.Types.Matches import Text.RE.REOptions import qualified Text.RE.PCRE.String as P_ST
examples/re-tutorial.lhs view
@@ -95,9 +95,6 @@ import Text.RE.REOptions import Text.RE.Replace import Text.RE.TDFA.String-import Text.RE.ZeInternals.Types.Capture-import Text.RE.ZeInternals.Types.CaptureID-import Text.RE.ZeInternals.Types.Match \end{code} If you are predominantly matching against a single type in your module then you will probably find it more convenient to use the relevant module@@ -483,7 +480,7 @@ The `REOptions_` type is defined in `Text.RE.REOptions` as follows: -%include "Text/RE/ZeInternals/Types/REOptions.lhs" "data REOptions_"+%include "Text/RE/REOptions.lhs" "data REOptions_" * `optionsMode` is an experimental feature that controls the RE parser.
lib/cabal-masters/executables-incl.cabal view
@@ -50,7 +50,7 @@ Other-Modules: TestKit -%build-depends-prog regex regex-with-pcre array base base-compat bytestring containers directory filepath heredoc regex-base regex-tdfa regex-tdfa-text regex-pcre-builtin smallcheck tasty tasty-hunit tasty-smallcheck template-haskell text unordered-containers+%build-depends-prog regex regex-with-pcre array base base-compat bytestring containers directory filepath heredoc regex-base regex-tdfa regex-tdfa-text regex-pcre-builtin shelly smallcheck tasty tasty-hunit tasty-smallcheck template-haskell text unordered-containers %test-exe re-tutorial Hs-Source-Dirs: examples
lib/cabal-masters/library-incl.cabal view
@@ -2,7 +2,6 @@ Hs-Source-Dirs: . Exposed-Modules: Text.RE- Text.RE.IsRegex Text.RE.PCRE Text.RE.PCRE.ByteString Text.RE.PCRE.ByteString.Lazy@@ -27,6 +26,7 @@ Text.RE.ZeInternals Text.RE.ZeInternals.AddCaptureNames Text.RE.ZeInternals.EscapeREString+ Text.RE.ZeInternals.Lex Text.RE.ZeInternals.NamedCaptures Text.RE.ZeInternals.PCRE Text.RE.ZeInternals.PreludeMacros@@ -51,6 +51,7 @@ Text.RE.ZeInternals.TestBench Text.RE.ZeInternals.Types.Capture Text.RE.ZeInternals.Types.CaptureID+ Text.RE.ZeInternals.Types.IsRegex Text.RE.ZeInternals.Types.LineNo Text.RE.ZeInternals.Types.Match Text.RE.ZeInternals.Types.Matches
lib/cabal-masters/regex.cabal view
@@ -7,7 +7,6 @@ Exposed-Modules: Text.RE- Text.RE.IsRegex Text.RE.REOptions Text.RE.Replace Text.RE.Summa@@ -27,11 +26,11 @@ Text.RE.ZeInternals Text.RE.ZeInternals.AddCaptureNames Text.RE.ZeInternals.EscapeREString+ Text.RE.ZeInternals.Lex Text.RE.ZeInternals.NamedCaptures Text.RE.ZeInternals.PreludeMacros Text.RE.ZeInternals.QQ Text.RE.ZeInternals.Replace- Text.RE.ZeInternals.Types.SearchReplace Text.RE.ZeInternals.SearchReplace Text.RE.ZeInternals.SearchReplace.TDFA Text.RE.ZeInternals.SearchReplace.TDFA.ByteString@@ -45,9 +44,11 @@ Text.RE.ZeInternals.TestBench Text.RE.ZeInternals.Types.Capture Text.RE.ZeInternals.Types.CaptureID+ Text.RE.ZeInternals.Types.IsRegex Text.RE.ZeInternals.Types.LineNo Text.RE.ZeInternals.Types.Match Text.RE.ZeInternals.Types.Matches+ Text.RE.ZeInternals.Types.SearchReplace %build-depends-lib array bytestring base base-compat containers hashable regex-base regex-tdfa regex-tdfa-text template-haskell text time time-locale-compat transformers unordered-containers
lib/mega-regex.cabal view
@@ -1,5 +1,5 @@ Name: regex-Version: 0.11.1.0+Version: 0.12.0.0 Synopsis: Toolkit for regex-base Description: A regular expression toolkit for regex-base with compile-time checking of RE syntax, data types for@@ -63,7 +63,7 @@ Source-Repository this Type: git Location: https://github.com/iconnect/regex.git- Tag: 0.11.1.0+ Tag: 0.12.0.0 @@ -71,7 +71,6 @@ Hs-Source-Dirs: . Exposed-Modules: Text.RE- Text.RE.IsRegex Text.RE.PCRE Text.RE.PCRE.ByteString Text.RE.PCRE.ByteString.Lazy@@ -96,6 +95,7 @@ Text.RE.ZeInternals Text.RE.ZeInternals.AddCaptureNames Text.RE.ZeInternals.EscapeREString+ Text.RE.ZeInternals.Lex Text.RE.ZeInternals.NamedCaptures Text.RE.ZeInternals.PCRE Text.RE.ZeInternals.PreludeMacros@@ -120,6 +120,7 @@ Text.RE.ZeInternals.TestBench Text.RE.ZeInternals.Types.Capture Text.RE.ZeInternals.Types.CaptureID+ Text.RE.ZeInternals.Types.IsRegex Text.RE.ZeInternals.Types.LineNo Text.RE.ZeInternals.Types.Match Text.RE.ZeInternals.Types.Matches@@ -194,7 +195,7 @@ -Werror Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0@@ -224,7 +225,7 @@ -Werror Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0@@ -251,7 +252,7 @@ -Werror Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0@@ -277,7 +278,7 @@ -Werror Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0@@ -306,7 +307,7 @@ -Werror Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , base >= 4 && < 5 , base-compat >= 0.6.0 , bytestring >= 0.10.2.0@@ -332,7 +333,7 @@ -Werror Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , base >= 4 && < 5 , base-compat >= 0.6.0 , bytestring >= 0.10.2.0@@ -355,7 +356,7 @@ -Werror Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0@@ -386,7 +387,7 @@ -Werror Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0@@ -420,7 +421,7 @@ -Werror Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , base >= 4 && < 5 , base-compat >= 0.6.0 , bytestring >= 0.10.2.0@@ -448,7 +449,7 @@ -Werror Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , base >= 4 && < 5 , base-compat >= 0.6.0 , bytestring >= 0.10.2.0@@ -476,7 +477,7 @@ -Werror Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0@@ -489,6 +490,7 @@ , regex-pcre-builtin >= 0.94.4.8.8.35 , regex-tdfa >= 1.2.0 , regex-tdfa-text >= 1.0.0.3+ , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2 , tasty-hunit >= 0.9.2@@ -515,7 +517,7 @@ -Werror Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0@@ -528,6 +530,7 @@ , regex-pcre-builtin >= 0.94.4.8.8.35 , regex-tdfa >= 1.2.0 , regex-tdfa-text >= 1.0.0.3+ , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2 , tasty-hunit >= 0.9.2@@ -555,7 +558,7 @@ -Werror Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0@@ -599,7 +602,7 @@ -Werror Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0@@ -645,7 +648,7 @@ -Werror Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0
lib/version.txt view
@@ -1,1 +1,1 @@-0.11.1.0+0.12.0.0
regex-examples.cabal view
@@ -1,5 +1,5 @@ Name: regex-examples-Version: 0.11.1.0+Version: 0.12.0.0 Synopsis: Tutorial, tests and example programs for regex Description: Tutorial, tests and example programs for regex, a Regular Expression Toolkit for regex-base with@@ -63,7 +63,7 @@ Source-Repository this Type: git Location: https://github.com/iconnect/regex.git- Tag: 0.11.1.0+ Tag: 0.12.0.0 Executable re-gen-cabals@@ -82,7 +82,7 @@ -Wwarn Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0@@ -112,7 +112,7 @@ -Wwarn Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0@@ -139,7 +139,7 @@ -Wwarn Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0@@ -165,7 +165,7 @@ -Wwarn Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0@@ -194,7 +194,7 @@ -Wwarn Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , base >= 4 && < 5 , base-compat >= 0.6.0 , bytestring >= 0.10.2.0@@ -220,7 +220,7 @@ -Wwarn Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , base >= 4 && < 5 , base-compat >= 0.6.0 , bytestring >= 0.10.2.0@@ -243,8 +243,8 @@ -Wwarn Build-depends:- regex == 0.11.1.0- , regex-with-pcre == 0.11.1.0+ regex == 0.12.0.0+ , regex-with-pcre == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0@@ -275,8 +275,8 @@ -Wwarn Build-depends:- regex == 0.11.1.0- , regex-with-pcre == 0.11.1.0+ regex == 0.12.0.0+ , regex-with-pcre == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0@@ -310,7 +310,7 @@ -Wwarn Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , base >= 4 && < 5 , base-compat >= 0.6.0 , bytestring >= 0.10.2.0@@ -338,7 +338,7 @@ -Wwarn Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , base >= 4 && < 5 , base-compat >= 0.6.0 , bytestring >= 0.10.2.0@@ -366,8 +366,8 @@ -Wwarn Build-depends:- regex == 0.11.1.0- , regex-with-pcre == 0.11.1.0+ regex == 0.12.0.0+ , regex-with-pcre == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0@@ -380,6 +380,7 @@ , regex-pcre-builtin >= 0.94.4.8.8.35 , regex-tdfa >= 1.2.0 , regex-tdfa-text >= 1.0.0.3+ , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2 , tasty-hunit >= 0.9.2@@ -406,8 +407,8 @@ -Wwarn Build-depends:- regex == 0.11.1.0- , regex-with-pcre == 0.11.1.0+ regex == 0.12.0.0+ , regex-with-pcre == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0@@ -420,6 +421,7 @@ , regex-pcre-builtin >= 0.94.4.8.8.35 , regex-tdfa >= 1.2.0 , regex-tdfa-text >= 1.0.0.3+ , shelly >= 1.6.1.2 , smallcheck >= 1.1.1 , tasty >= 0.10.1.2 , tasty-hunit >= 0.9.2@@ -447,7 +449,7 @@ -Wwarn Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0@@ -491,7 +493,7 @@ -Wwarn Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0@@ -537,7 +539,7 @@ -Wwarn Build-depends:- regex == 0.11.1.0+ regex == 0.12.0.0 , array >= 0.4 , base >= 4 && < 5 , base-compat >= 0.6.0
src/Text/RE/PCRE/ByteString.hs view
@@ -39,14 +39,19 @@ -- $options , SimpleREOptions(..) -- * Compiling and Escaping REs+ , SearchReplace(..) , compileRegex , compileRegexWith+ , compileSearchReplace+ , compileSearchReplaceWith , escape , escapeWith , escapeREString -- * The Classic rexex-base Match Operators , (=~) , (=~~)+ -- * IsRegex+ , IsRegex(..) -- * The Quasi Quoters and Minor Functions -- $re , module Text.RE.ZeInternals.PCRE@@ -57,14 +62,13 @@ import Prelude.Compat import qualified Data.ByteString as B import Data.Typeable-import Text.Regex.Base-import Text.RE-import Text.RE.ZeInternals.AddCaptureNames-import Text.RE.ZeInternals.SearchReplace.PCRE.ByteString-import Text.RE.IsRegex import Text.RE.REOptions import Text.RE.Replace+import Text.RE.ZeInternals.AddCaptureNames+import Text.RE.ZeInternals.SearchReplace.PCRE.ByteString import Text.RE.ZeInternals.PCRE+import Text.RE.ZeInternals.Types.IsRegex+import Text.Regex.Base import qualified Text.Regex.PCRE as PCRE @@ -101,7 +105,7 @@ -- e.g., to prefix the first string of four hex digits in the imput text, -- if any, with @0x@: ----- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])+-- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])@ -- (?=~/) :: B.ByteString -> SearchReplace RE B.ByteString -> B.ByteString (?=~/) = flip searchReplaceFirst
src/Text/RE/PCRE/ByteString/Lazy.hs view
@@ -39,14 +39,19 @@ -- $options , SimpleREOptions(..) -- * Compiling and Escaping REs+ , SearchReplace(..) , compileRegex , compileRegexWith+ , compileSearchReplace+ , compileSearchReplaceWith , escape , escapeWith , escapeREString -- * The Classic rexex-base Match Operators , (=~) , (=~~)+ -- * IsRegex+ , IsRegex(..) -- * The Quasi Quoters and Minor Functions -- $re , module Text.RE.ZeInternals.PCRE@@ -57,14 +62,13 @@ import Prelude.Compat import qualified Data.ByteString.Lazy as LBS import Data.Typeable-import Text.Regex.Base-import Text.RE-import Text.RE.ZeInternals.AddCaptureNames-import Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy-import Text.RE.IsRegex import Text.RE.REOptions import Text.RE.Replace+import Text.RE.ZeInternals.AddCaptureNames+import Text.RE.ZeInternals.SearchReplace.PCRE.ByteString.Lazy import Text.RE.ZeInternals.PCRE+import Text.RE.ZeInternals.Types.IsRegex+import Text.Regex.Base import qualified Text.Regex.PCRE as PCRE @@ -101,7 +105,7 @@ -- e.g., to prefix the first string of four hex digits in the imput text, -- if any, with @0x@: ----- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])+-- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])@ -- (?=~/) :: LBS.ByteString -> SearchReplace RE LBS.ByteString -> LBS.ByteString (?=~/) = flip searchReplaceFirst
src/Text/RE/PCRE/Sequence.hs view
@@ -39,14 +39,19 @@ -- $options , SimpleREOptions(..) -- * Compiling and Escaping REs+ , SearchReplace(..) , compileRegex , compileRegexWith+ , compileSearchReplace+ , compileSearchReplaceWith , escape , escapeWith , escapeREString -- * The Classic rexex-base Match Operators , (=~) , (=~~)+ -- * IsRegex+ , IsRegex(..) -- * The Quasi Quoters and Minor Functions -- $re , module Text.RE.ZeInternals.PCRE@@ -57,14 +62,13 @@ import Prelude.Compat import qualified Data.Sequence as S import Data.Typeable-import Text.Regex.Base-import Text.RE-import Text.RE.ZeInternals.AddCaptureNames-import Text.RE.ZeInternals.SearchReplace.PCRE.Sequence-import Text.RE.IsRegex import Text.RE.REOptions import Text.RE.Replace+import Text.RE.ZeInternals.AddCaptureNames+import Text.RE.ZeInternals.SearchReplace.PCRE.Sequence import Text.RE.ZeInternals.PCRE+import Text.RE.ZeInternals.Types.IsRegex+import Text.Regex.Base import qualified Text.Regex.PCRE as PCRE @@ -101,7 +105,7 @@ -- e.g., to prefix the first string of four hex digits in the imput text, -- if any, with @0x@: ----- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])+-- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])@ -- (?=~/) :: (S.Seq Char) -> SearchReplace RE (S.Seq Char) -> (S.Seq Char) (?=~/) = flip searchReplaceFirst
src/Text/RE/PCRE/String.hs view
@@ -39,14 +39,19 @@ -- $options , SimpleREOptions(..) -- * Compiling and Escaping REs+ , SearchReplace(..) , compileRegex , compileRegexWith+ , compileSearchReplace+ , compileSearchReplaceWith , escape , escapeWith , escapeREString -- * The Classic rexex-base Match Operators , (=~) , (=~~)+ -- * IsRegex+ , IsRegex(..) -- * The Quasi Quoters and Minor Functions -- $re , module Text.RE.ZeInternals.PCRE@@ -57,14 +62,13 @@ import Prelude.Compat import Data.Typeable-import Text.Regex.Base-import Text.RE-import Text.RE.ZeInternals.AddCaptureNames-import Text.RE.ZeInternals.SearchReplace.PCRE.String-import Text.RE.IsRegex import Text.RE.REOptions import Text.RE.Replace+import Text.RE.ZeInternals.AddCaptureNames+import Text.RE.ZeInternals.SearchReplace.PCRE.String import Text.RE.ZeInternals.PCRE+import Text.RE.ZeInternals.Types.IsRegex+import Text.Regex.Base import qualified Text.Regex.PCRE as PCRE @@ -101,7 +105,7 @@ -- e.g., to prefix the first string of four hex digits in the imput text, -- if any, with @0x@: ----- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])+-- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])@ -- (?=~/) :: String -> SearchReplace RE String -> String (?=~/) = flip searchReplaceFirst
src/Text/RE/TDFA/ByteString.hs view
@@ -39,14 +39,19 @@ -- $options , SimpleREOptions(..) -- * Compiling and Escaping REs+ , SearchReplace(..) , compileRegex , compileRegexWith+ , compileSearchReplace+ , compileSearchReplaceWith , escape , escapeWith , escapeREString -- * The Classic rexex-base Match Operators , (=~) , (=~~)+ -- * IsRegex+ , IsRegex(..) -- * The Quasi Quoters and Minor Functions -- $re , module Text.RE.ZeInternals.TDFA@@ -57,14 +62,13 @@ import Prelude.Compat import qualified Data.ByteString as B import Data.Typeable-import Text.Regex.Base-import Text.RE-import Text.RE.ZeInternals.AddCaptureNames-import Text.RE.ZeInternals.SearchReplace.TDFA.ByteString-import Text.RE.IsRegex import Text.RE.REOptions import Text.RE.Replace+import Text.RE.ZeInternals.AddCaptureNames+import Text.RE.ZeInternals.SearchReplace.TDFA.ByteString import Text.RE.ZeInternals.TDFA+import Text.RE.ZeInternals.Types.IsRegex+import Text.Regex.Base import qualified Text.Regex.TDFA as TDFA @@ -101,7 +105,7 @@ -- e.g., to prefix the first string of four hex digits in the imput text, -- if any, with @0x@: ----- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])+-- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])@ -- (?=~/) :: B.ByteString -> SearchReplace RE B.ByteString -> B.ByteString (?=~/) = flip searchReplaceFirst
src/Text/RE/TDFA/ByteString/Lazy.hs view
@@ -39,14 +39,19 @@ -- $options , SimpleREOptions(..) -- * Compiling and Escaping REs+ , SearchReplace(..) , compileRegex , compileRegexWith+ , compileSearchReplace+ , compileSearchReplaceWith , escape , escapeWith , escapeREString -- * The Classic rexex-base Match Operators , (=~) , (=~~)+ -- * IsRegex+ , IsRegex(..) -- * The Quasi Quoters and Minor Functions -- $re , module Text.RE.ZeInternals.TDFA@@ -57,14 +62,13 @@ import Prelude.Compat import qualified Data.ByteString.Lazy.Char8 as LBS import Data.Typeable-import Text.Regex.Base-import Text.RE-import Text.RE.ZeInternals.AddCaptureNames-import Text.RE.ZeInternals.SearchReplace.TDFA.ByteString.Lazy-import Text.RE.IsRegex import Text.RE.REOptions import Text.RE.Replace+import Text.RE.ZeInternals.AddCaptureNames+import Text.RE.ZeInternals.SearchReplace.TDFA.ByteString.Lazy import Text.RE.ZeInternals.TDFA+import Text.RE.ZeInternals.Types.IsRegex+import Text.Regex.Base import qualified Text.Regex.TDFA as TDFA @@ -101,7 +105,7 @@ -- e.g., to prefix the first string of four hex digits in the imput text, -- if any, with @0x@: ----- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])+-- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])@ -- (?=~/) :: LBS.ByteString -> SearchReplace RE LBS.ByteString -> LBS.ByteString (?=~/) = flip searchReplaceFirst
src/Text/RE/TDFA/Sequence.hs view
@@ -39,14 +39,19 @@ -- $options , SimpleREOptions(..) -- * Compiling and Escaping REs+ , SearchReplace(..) , compileRegex , compileRegexWith+ , compileSearchReplace+ , compileSearchReplaceWith , escape , escapeWith , escapeREString -- * The Classic rexex-base Match Operators , (=~) , (=~~)+ -- * IsRegex+ , IsRegex(..) -- * The Quasi Quoters and Minor Functions -- $re , module Text.RE.ZeInternals.TDFA@@ -57,14 +62,13 @@ import Prelude.Compat import qualified Data.Sequence as S import Data.Typeable-import Text.Regex.Base-import Text.RE-import Text.RE.ZeInternals.AddCaptureNames-import Text.RE.ZeInternals.SearchReplace.TDFA.Sequence-import Text.RE.IsRegex import Text.RE.REOptions import Text.RE.Replace+import Text.RE.ZeInternals.AddCaptureNames+import Text.RE.ZeInternals.SearchReplace.TDFA.Sequence import Text.RE.ZeInternals.TDFA+import Text.RE.ZeInternals.Types.IsRegex+import Text.Regex.Base import qualified Text.Regex.TDFA as TDFA @@ -101,7 +105,7 @@ -- e.g., to prefix the first string of four hex digits in the imput text, -- if any, with @0x@: ----- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])+-- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])@ -- (?=~/) :: (S.Seq Char) -> SearchReplace RE (S.Seq Char) -> (S.Seq Char) (?=~/) = flip searchReplaceFirst
src/Text/RE/TDFA/String.hs view
@@ -39,14 +39,19 @@ -- $options , SimpleREOptions(..) -- * Compiling and Escaping REs+ , SearchReplace(..) , compileRegex , compileRegexWith+ , compileSearchReplace+ , compileSearchReplaceWith , escape , escapeWith , escapeREString -- * The Classic rexex-base Match Operators , (=~) , (=~~)+ -- * IsRegex+ , IsRegex(..) -- * The Quasi Quoters and Minor Functions -- $re , module Text.RE.ZeInternals.TDFA@@ -57,14 +62,13 @@ import Prelude.Compat import Data.Typeable-import Text.Regex.Base-import Text.RE-import Text.RE.ZeInternals.AddCaptureNames-import Text.RE.ZeInternals.SearchReplace.TDFA.String-import Text.RE.IsRegex import Text.RE.REOptions import Text.RE.Replace+import Text.RE.ZeInternals.AddCaptureNames+import Text.RE.ZeInternals.SearchReplace.TDFA.String import Text.RE.ZeInternals.TDFA+import Text.RE.ZeInternals.Types.IsRegex+import Text.Regex.Base import qualified Text.Regex.TDFA as TDFA @@ -101,7 +105,7 @@ -- e.g., to prefix the first string of four hex digits in the imput text, -- if any, with @0x@: ----- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])+-- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])@ -- (?=~/) :: String -> SearchReplace RE String -> String (?=~/) = flip searchReplaceFirst
src/Text/RE/TDFA/Text.hs view
@@ -39,14 +39,19 @@ -- $options , SimpleREOptions(..) -- * Compiling and Escaping REs+ , SearchReplace(..) , compileRegex , compileRegexWith+ , compileSearchReplace+ , compileSearchReplaceWith , escape , escapeWith , escapeREString -- * The Classic rexex-base Match Operators , (=~) , (=~~)+ -- * IsRegex+ , IsRegex(..) -- * The Quasi Quoters and Minor Functions -- $re , module Text.RE.ZeInternals.TDFA@@ -57,14 +62,13 @@ import Prelude.Compat import qualified Data.Text as T import Data.Typeable-import Text.Regex.Base-import Text.RE-import Text.RE.ZeInternals.AddCaptureNames-import Text.RE.ZeInternals.SearchReplace.TDFA.Text-import Text.RE.IsRegex import Text.RE.REOptions import Text.RE.Replace+import Text.RE.ZeInternals.AddCaptureNames+import Text.RE.ZeInternals.SearchReplace.TDFA.Text import Text.RE.ZeInternals.TDFA+import Text.RE.ZeInternals.Types.IsRegex+import Text.Regex.Base import qualified Text.Regex.TDFA as TDFA @@ -101,7 +105,7 @@ -- e.g., to prefix the first string of four hex digits in the imput text, -- if any, with @0x@: ----- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])+-- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])@ -- (?=~/) :: T.Text -> SearchReplace RE T.Text -> T.Text (?=~/) = flip searchReplaceFirst
src/Text/RE/TDFA/Text/Lazy.hs view
@@ -39,14 +39,19 @@ -- $options , SimpleREOptions(..) -- * Compiling and Escaping REs+ , SearchReplace(..) , compileRegex , compileRegexWith+ , compileSearchReplace+ , compileSearchReplaceWith , escape , escapeWith , escapeREString -- * The Classic rexex-base Match Operators , (=~) , (=~~)+ -- * IsRegex+ , IsRegex(..) -- * The Quasi Quoters and Minor Functions -- $re , module Text.RE.ZeInternals.TDFA@@ -57,14 +62,13 @@ import Prelude.Compat import qualified Data.Text.Lazy as TL import Data.Typeable-import Text.Regex.Base-import Text.RE-import Text.RE.ZeInternals.AddCaptureNames-import Text.RE.ZeInternals.SearchReplace.TDFA.Text.Lazy-import Text.RE.IsRegex import Text.RE.REOptions import Text.RE.Replace+import Text.RE.ZeInternals.AddCaptureNames+import Text.RE.ZeInternals.SearchReplace.TDFA.Text.Lazy import Text.RE.ZeInternals.TDFA+import Text.RE.ZeInternals.Types.IsRegex+import Text.Regex.Base import qualified Text.Regex.TDFA as TDFA @@ -101,7 +105,7 @@ -- e.g., to prefix the first string of four hex digits in the imput text, -- if any, with @0x@: ----- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])+-- @(?=~\/ [ed|[0-9A-Fa-f]{4}\/\/\/0x$0|])@ -- (?=~/) :: TL.Text -> SearchReplace RE TL.Text -> TL.Text (?=~/) = flip searchReplaceFirst