typedef enum { ... } SilcBufferRegexFlags;


Regular expression flags for SILC_STR_REGEX macro. The flags can be used to manipulate the behavior of the SILC_STR_REGEX. All flags may be combined unless otherwise stated.


typedef enum {
  SILC_STR_REGEX_NONE                 = 0x00000000,

  /* By default mismatch will be skipped.  Skipping means that none of the
     operations inside the SILC_STR_REGEX are executed.  Set this flag if
     mismatch should cause error and stopping of the formatting/unformatting. */
  SILC_STR_REGEX_MISMATCH             = 0x00000001,

  /* By default only the first match is found.  Set this flag to find
     all matches. */
  SILC_STR_REGEX_ALL                  = 0x00000002,

  /* By default the buffer position is advanced to the position of the
     first match.  Set this flag if the buffer should not be advanced to
     the match. */
  SILC_STR_REGEX_NO_ADVANCE           = 0x00000004,

  /* By default SILC_STR_REGEX performs the match on the whole buffer.  Set
     this flag to make it behave like sed and match line by line.  Each line
     must end with '\n'.  If buffer doesn't have '\n' it is considered to be
     one line.  Note that, any formatting done immediately after SILC_STR_REGEX
     block with this flag will be formatted to the end of the buffer (after
     last line).  Use SILC_STR_OFFSET* macros to change the position if
     needed.  Also note that, any encoding macro inside the SILC_STR_REGEX
     block will see only the matched line (including '\n'), instead of whole
     buffer after the match. */
  SILC_STR_REGEX_NL                   = 0x00000008,

  /* Set this flag to not match the regular expression, but to match everything
     else.  When combined with SILC_STR_REGEX_NL this flag matches all other
     lines except the ones with matching regular expression. */
  SILC_STR_REGEX_NOT                  = 0x00000010,

  /* By default the buffer is advanced to the first match and the rest of the
     buffer remains as is.  Set this flag to pass the exact match to the
     SILC_STR_* macros in the SILC_STR_REGEX block; macros see the start of
     the match and the end of the match, but not rest of the buffer (ie. with
     match 'foo' the size of the buffer is 3 bytes). */
  SILC_STR_REGEX_INCLUSIVE            = 0x00000020,
} SilcBufferRegexFlags;