Show / Hide Table of Contents

Enum RXFlags

Flags for regexp constructor. Documented in PCRE help topic pcre2api.

[Flags]
public enum RXFlags : ulong
Remarks

Many options also can be specified in regular expression (RE):

  • These can be anywhere in RE: (?i)CASELESS, (?m)MULTILINE, (?s)DOTALL, (?n)NO_AUTO_CAPTURE, (?x)EXTENDED, (?xx)EXTENDED_MORE, (?J)DUPNAMES, (?U)UNGREEDY. Can be multiple, like (?ms). Can be unset, like (?-i). RE "\Qtext\E" is like RE "text" with flag LITERAL.
  • Instead of ANCHORED can be used \G at the start of RE. Or ^, except in multiline mode.
  • Instead of ENDANCHORED can be used \z at the end of RE. Or $, except in multiline mode.
  • Flag UTF is implicitly added if RE contains non-ASCII characters and there is no flag NEVER_UTF.
  • These must be at the very start and are named like flags: (*UTF), (*UCP), (*NOTEMPTY), (*NOTEMPTY_ATSTART), (*NO_AUTO_POSSESS), (*NO_DOTSTAR_ANCHOR), (*NO_START_OPT).
  • More info in PCRE syntax reference.

Some of RXFlags flags also exist in RXMatchFlags. You can set them either when calling regexp constructor or when calling regexp functions that have parameter more. You can use different flags for each function call with the same regexp variable.


Namespace: Au.Types
Assembly: Au.dll

Fields

Name Description
ALLOW_EMPTY_CLASS
ALT_BSUX
ALT_CIRCUMFLEX
ALT_VERBNAMES
ANCHORED
AUTO_CALLOUT
CASELESS
DOLLAR_ENDONLY
DOTALL
DUPNAMES
ENDANCHORED
EXTENDED
EXTENDED_MORE
FIRSTLINE
LITERAL
MATCH_LINE
MATCH_UNSET_BACKREF
MATCH_WORD
MULTILINE
NEVER_BACKSLASH_C
NEVER_UCP
NEVER_UTF
NOTBOL
NOTEMPTY
NOTEMPTY_ATSTART
NOTEOL
NO_AUTO_CAPTURE
NO_AUTO_POSSESS
NO_DOTSTAR_ANCHOR
NO_START_OPTIMIZE
NO_UTF_CHECK
PARTIAL_HARD
PARTIAL_SOFT
UCP
UNGREEDY
UTF

Fully support Unicode text (case-insensitivity etc). More info in PCRE documentation topic pcre2unicode. This flag is implicitly added if regular expression contains non-ASCII characters and there is no flag NEVER_UTF.

Extension Methods

ExtMisc.HasAny<RXFlags>(RXFlags, RXFlags)
ExtMisc.Has<RXFlags>(RXFlags, RXFlags)
ExtMisc.SetFlag<RXFlags>(ref RXFlags, RXFlags, bool)