The regexpr package

[ Tags: lgpl, library, text ] [ Propose Tags ]

Regular expression library like Perl and Ruby's regular expressions. This package has a module RegexPR. And RegexPR export functions matchRegexPR and gsubRegexPR.

matchRegexPR      :: String -> String -> Maybe ((String, (String, String)), [(Int, String)])
multiMatchRegexPR :: String -> String -> [ ((String, (String, String)), [(Int, String)]) ]
gmatchRegexPR     :: String -> String -> [ ((String, (String, String)), [(Int, String)]) ]
getbrsRegexPR     :: String -> String -> [ String ]
ggetbrsRegexPR    :: String -> String -> [ [ String ] ]
subRegexPR        :: String -> String -> String -> String
subRegexPRBy      :: String -> (String -> String) -> String -> String
gsubRegexPR       :: String -> String -> String -> String
gsubRegexPRBy     :: String -> (String -> String) -> String -> String
splitRegexPR      :: String -> String -> [String]

Examples

matchRegexPR "ab(cde)f\\1" "kkkabcdefcdefgh" =>
             Just (("abcdefcde", ("kkk", "fgh")),[(1,"cde")])
matchRegexPR "(?<=hij)abc" "kkkabchijabcde" =>
             Just (("abc",("kkkabchij","de")),[])
gsubRegexPR "\\G(\\d\\d\\d)" "\\1," "123456 789" => "123,456, 789"
subRegexPR "(?<=(.)(.)(.))e" " \\3\\2\\1 " "abcdefg" => "abcd dcb fg"
gsubRegexPR "(?ixm)  aBc  . # comment \n\n" "abc!" "abc\nABCDAbcAbc" =>
            "abc!abc!abc!bc"
gmatchRegexPR "(?=(?<!(?!abc)))abc" "abcdefdefabc" =>
             [(("abc", ("", "defdefabc")), []), (("abc", ("defdef", "")), [])]
splitRegexPR "\\s*,\\s*" "a,b ,c\t ,d , e" => ["a","b","c","d","e"]

Properties

Versions 0.1.3, 0.1.5, 0.1.6, 0.1.7, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.5, 0.2.6, 0.2.8, 0.2.9, 0.3, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.4, 0.5, 0.5.1, 0.5.3, 0.5.4
Dependencies base (<5), HUnit, mtl, mtlparse (>=0.1.0) [details]
License LGPL
Author Yoshikuni Jujo <PAF01143@nifty.ne.jp>
Maintainer PAF01143@nifty.ne.jp
Category Text
Home page http://homepage3.nifty.com/salamander/second/projects/regexpr/
Uploaded Wed Jul 6 06:48:09 UTC 2011 by YoshikuniJujo
Distributions Debian:0.5.4, Fedora:0.5.4, NixOS:0.5.4
Downloads 7282 total (33 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees