Copyright | (c) 2019-2020 Vaclav Svejcar |
---|---|
License | BSD-3-Clause |
Maintainer | vaclav.svejcar@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Extends functionalify provided by Text.Regex.PCRE.Light and Text.Regex.PCRE.Heavy that more suits the needs of this application.
Data Types
Represents compiled regex, encapsulates the actual implementation.
Regex Regex |
data RegexError Source #
Exception specific to the Headroom.Data.Regex module.
CompilationFailed !Text !Text | given input cannot be compiled as regex |
Instances
Show RegexError Source # | |
Defined in Headroom.Data.Regex showsPrec :: Int -> RegexError -> ShowS # show :: RegexError -> String # showList :: [RegexError] -> ShowS # | |
Exception RegexError Source # | |
Defined in Headroom.Data.Regex toException :: RegexError -> SomeException # fromException :: SomeException -> Maybe RegexError # displayException :: RegexError -> String # |
Regex Functions
:: MonadThrow m | |
=> Text | regex to compile |
-> m Regex | compiled regex |
Compiles given regex in runtime. If possible, prefer the re
quasi quotation version that does the same at compile time.
re :: QuasiQuoter Source #
A QuasiQuoter for regular expressions that does a compile time check.