LicenseRef-LGPL licensed by Yoshikuni Jujo
Maintained by [email protected]

Module documentation for 0.5.4

This version can be pinned in stack with:[email protected]:a942463f1f25638c81b1c1feab5f958f6f404114113b7788f6a7db95f60e5fe2,2202
  • Text
    • Text.RegexPR

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"]
Depends on 4 packages(full list with versions):
Used by 2 packages in lts-0.7(full list with versions):