regex-compat 0.95.1 → 0.95.2.0
raw patch · 3 files changed
+63/−54 lines, 3 filesdep ~arraydep ~basedep ~regex-basenew-uploader
Dependency ranges changed: array, base, regex-base, regex-posix
Files
- ChangeLog.md +6/−0
- Text/Regex.hs +19/−19
- regex-compat.cabal +38/−35
+ ChangeLog.md view
@@ -0,0 +1,6 @@+See also http://pvp.haskell.org/faq++## 0.95.2.0++- Declare `Text.Regex` module `Trustworthy` under SafeHaskell+
Text/Regex.hs view
@@ -4,8 +4,8 @@ -- Module : Text.Regex -- Copyright : (c) Chris Kuklewicz 2006, derived from (c) The University of Glasgow 2001 -- License : BSD-style (see the file LICENSE)--- --- Maintainer : libraries@haskell.org+--+-- Maintainer : hvr@gnu.org -- Stability : experimental -- Portability : non-portable (regex-base needs MPTC+FD) --@@ -46,9 +46,9 @@ -- case-sensitive options can be changed from the default settings. mkRegexWithOpts :: String -- ^ The regular expression to compile- -> Bool -- ^ 'True' @\<=>@ @\'^\'@ and @\'$\'@ match the beginning and - -- end of individual lines respectively, and @\'.\'@ does /not/- -- match the newline character.+ -> Bool -- ^ 'True' @\<=>@ @\'^\'@ and @\'$\'@ match the beginning and+ -- end of individual lines respectively, and @\'.\'@ does /not/+ -- match the newline character. -> Bool -- ^ 'True' @\<=>@ matching is case-sensitive -> Regex -- ^ Returns: the compiled regular expression @@ -60,25 +60,25 @@ -- | Match a regular expression against a string matchRegex- :: Regex -- ^ The regular expression- -> String -- ^ The string to match against- -> Maybe [String] -- ^ Returns: @'Just' strs@ if the match succeeded- -- (and @strs@ is the list of subexpression matches),- -- or 'Nothing' otherwise.+ :: Regex -- ^ The regular expression+ -> String -- ^ The string to match against+ -> Maybe [String] -- ^ Returns: @'Just' strs@ if the match succeeded+ -- (and @strs@ is the list of subexpression matches),+ -- or 'Nothing' otherwise. matchRegex p str = fmap (\(_,_,_,str) -> str) (matchRegexAll p str) -- | Match a regular expression against a string, returning more information -- about the match. matchRegexAll- :: Regex -- ^ The regular expression- -> String -- ^ The string to match against+ :: Regex -- ^ The regular expression+ -> String -- ^ The string to match against -> Maybe ( String, String, String, [String] )- -- ^ Returns: 'Nothing' if the match failed, or:- -- - -- > Just ( everything before match,- -- > portion matched,- -- > everything after the match,- -- > subexpression matches )+ -- ^ Returns: 'Nothing' if the match failed, or:+ --+ -- > Just ( everything before match,+ -- > portion matched,+ -- > everything after the match,+ -- > subexpression matches ) matchRegexAll p str = matchM p str @@ -138,7 +138,7 @@ splitRegex :: Regex -> String -> [String] splitRegex _ [] = []-splitRegex delim strIn = +splitRegex delim strIn = let matches = map (!0) (matchAll delim strIn) go _i str [] = str : [] go i str ((off,len):rest) =
regex-compat.cabal view
@@ -1,36 +1,39 @@-Name: regex-compat-Version: 0.95.1-Cabal-Version: >=1.2-License: BSD3-License-File: LICENSE-Copyright: Copyright (c) 2006, Christopher Kuklewicz-Author: Christopher Kuklewicz-Maintainer: TextRegexLazy@personal.mightyreason.com-Stability: Seems to work, passes a few tests-Homepage: http://sourceforge.net/projects/lazy-regex-Package-URL: http://darcs.haskell.org/packages/regex-unstable/regex-compat/-Synopsis: Replaces/Enhances Text.Regex-Description: One module layer over regex-posix to replace Text.Regex-Category: Text-Tested-With: GHC-Build-Type: Simple-flag newBase- description: Choose base >= 4- default: True-flag splitBase- description: Choose the new smaller, split-up base package.- default: True+cabal-version: 1.12+name: regex-compat+version: 0.95.2.0++build-type: Simple+license: BSD3+license-file: LICENSE+copyright: Copyright (c) 2006, Christopher Kuklewicz+author: Christopher Kuklewicz+maintainer: hvr@gnu.org+bug-reports: https://github.com/hvr/regex-compat/issues+synopsis: Replaces/Enhances "Text.Regex"+category: Text+description:+ One module compat layer over <//hackage.haskell.org/package/regex-posix regex-posix> to replace "Text.Regex".+ .+ See also <https://wiki.haskell.org/Regular_expressions> for more information.++extra-source-files: ChangeLog.md++source-repository head+ type: git+ location: https://github.com/hvr/regex-compat.git+ library- if flag(newBase)- Build-Depends: base >= 4 && < 5, regex-base >= 0.93, regex-posix >= 0.95.1, array- else- if flag(splitBase)- Build-Depends: base >= 3.0, regex-base >= 0.93, regex-posix >= 0.95.1, array- else- Build-Depends: base < 3.0, regex-base >= 0.93, regex-posix >= 0.95.1- Exposed-Modules: Text.Regex- Buildable: True- Extensions: MultiParamTypeClasses, FunctionalDependencies- GHC-Options: -Wall -O2- -- GHC-Options: -Wall -Werror -O2- -- GHC-Options: -Wall -ddump-minimal-imports+ exposed-modules: Text.Regex++ build-depends: base >= 4.3 && < 4.14+ , regex-base == 0.94.*+ , regex-posix == 0.96.*+ , array >= 0.3 && < 0.6++ default-language: Haskell2010+ default-extensions: MultiParamTypeClasses, FunctionalDependencies++ if impl(ghc >= 7.2)+ default-extensions: Trustworthy++ ghc-options: -Wall