Regex -package:gi-glib
The TDFA backend specific
Regex type, used by this module's
RegexOptions and
RegexMaker.
A compiled regular expression.
Regular expression matching. Uses the POSIX regular expression
interface in
Text.Regex.Posix.
A compiled regular expression.
A compiled regular expression
A compiled regular expression.
Regex values are usually constructed using the
regex or
regex' functions. This type is also an instance of
IsString, so if you have the
OverloadedStrings
language extension enabled, you can construct a
Regex by simply
writing the pattern in quotes (though this does not allow you to
specify any
Options).
Regular expression support for Unicode, implemented as bindings to the
International Components for Unicode (ICU) libraries.
The syntax and behaviour of ICU regular expressions are Perl-like. For
complete details, see the ICU User Guide entry at
http://userguide.icu-project.org/strings/regexp.
Note: The functions in this module are not thread safe. For
thread safe use, see
clone below, or use the pure functions in
Data.Text.ICU.
A compiled regular expression.
Regex values are usually constructed using the
regex or
regex' functions. This type is also an instance of
IsString, so if you have the
OverloadedStrings
language extension enabled, you can construct a
Regex by simply
writing the pattern in quotes (though this does not allow you to
specify any
Options).
An abstract pointer to a compiled PCRE Regex structure The structure
allocated by the PCRE library will be deallocated automatically by the
Haskell storage manager.
The first string is the regex pattern, the second is the regex options
string. Options are identified by characters, which must be listed in
alphabetical order. Valid options are *i* for case insensitive
matching, *m* for multiline matching, *x* for verbose mode, *l* to
make \w, \W, etc. locale dependent, *s* for dotall mode ("." matches
everything), and *u* to make \w, \W, etc. match unicode.
Easy regular expression helpers, currently based on regex-tdfa. These
should:
- be cross-platform, not requiring C libraries
- support unicode
- support extended regular expressions
- support replacement, with backreferences etc.
- support splitting
- have mnemonic names
- have simple monomorphic types
- work with simple strings
Regex strings are automatically compiled into regular expressions the
first time they are seen, and these are cached. If you use a huge
number of unique regular expressions this might lead to increased
memory usage. Several functions have memoised variants (*Memo), which
also trade space for time.
Currently two APIs are provided:
- The old partial one (with ' suffixes') which will call error on
any problem (eg with malformed regexps). This comes from hledger's
origin as a command-line tool.
- The new total one which will return an error message. This is
better for long-running apps like hledger-web.
Current limitations:
- (?i) and similar are not supported
The TDFA backend specific
Regex type, used by this module's
RegexOptions and
RegexMaker.
An abstract pointer to a compiled PCRE Regex structure The structure
allocated by the PCRE library will be deallocated automatically by the
Haskell storage manager.