Configure Oniguruma syntax using OnigSyntaxType
masterOniguruma's syntax and behavior are configured by populating an OnigSyntaxType struct. This struct allows you to define specific syntax operators and behaviors, similar to how built-in syntaxes are defined.
Configuration is organized into three 32-bit unsigned int groups:
op: Roughly corresponds to "basic regex" configuration.op2: Roughly corresponds to "advanced regex" configuration.behavior: Describes how the engine handles broken input, bad input, or undefined corner cases.
Additionally, the struct contains:
options: Defines the defaultOnigOptionTypeused if no options are provided toonig_new().meta_char_table: Used whenONIG_SYN_OP_VARIABLE_META_CHARACTERSis enabled, allowing metacharacters (like*or?) to be replaced with custom alternates (e.g., using%instead of.*for SQL-style syntax).
typedef struct {
unsigned int op;
unsigned int op2;
unsigned int behavior;
OnigOptionType options; /* default option */
OnigMetaCharTableType meta_char_table;
} OnigSyntaxType;