Safe Haskell | None |
---|---|
Language | Haskell2010 |
Text.Regex.TDFA.QuasiQuoter
Description
Quasi-quoters for Text.Regex.TDFA (extended POSIX) regular expressions. Refer to that module's documentation for more information on supported features.
Quasi-quoters included in this module are:
- re :: QuasiQuoter
- pat :: QuasiQuoter
Documentation
re :: QuasiQuoter Source #
Quasi-quoter for Text.Regex.TDFA (extended POSIX) regular expressions. Refer to that module's documentation for more information on supported features.
See the documentation of unescape
for escape sequences this
quasi-quoter supports.
[re|flags;regexp|]
splices the expression to compile the AST
(of type Pattern
) of regexp
using the
CompOption
and
ExecOption
indicated by flags
. Incorrect
flags or a failure to parse the regular expression is a
compile-time error.
Examples:
[re|ga;a+b+c+|]
hasflags = MCgRaN
andregexp = a+b+c+
.[re|;(z*)|]
hasflags = MCGRaN
andregexp = (z*)
.
Every flag name is assigned a unique upper and lower case letter pair. The uppercase letter indicates the flag to be True ("on"), and the lowercase letter indicates the flag to be False ("off").
Flag name | True | False | Default -------------------+--------+------------------- Multiline | M | m | M Case sensitive | C | c | C Capture groups | G | g | G Right associative | R | r | R Last star greedy | A | a | a New syntax | N | n | N
Refer to CompOption
and
ExecOption
for the meanings of each flag.
For the significance of associativity see https://wiki.haskell.org/Regex_Posix Section 3 "Types of failure".
The default flags are MCGRaN
. Zero or more explicit flags must be
specified in the flags
field. Explicit flags take precedence over
default flags. Every explicit flag must occur at most once. If a
flag is explicit the negated flag must not also be.
pat :: QuasiQuoter Source #
Quasi-quoter for Text.Regex.TDFA (extended POSIX) regular expressions. Refer to that module's documentation for more information on supported features.
See the documentation of unescape
for escape sequences this
quasi-quoter supports.
[pat|regexp]
splices the AST (of type
Pattern
) of regexp
. A parse failure is a
compile-time error.