core/text/regex/common
regex_common
Types
2Flag
Flag :: enum u8 {
// Multiline: treat `^` and `$` as if they also match newlines.
Multiline = 0,
// Case Insensitive: treat `a-z` as if it was also `A-Z`.
Case_Insensitive = 1,
// Ignore Whitespace: bypass unescaped whitespace outside of classes.
Ignore_Whitespace = 2,
// Unicode: let the compiler and virtual machine know to expect Unicode strings.
Unicode = 3,
// No Capture: avoid saving capture group data entirely.
No_Capture = 4,
// No Optimization: do not pass the pattern through the optimizer; for debugging.
No_Optimization = 5,
}SourceFlags
Flags :: bit_set[Flag; u8]SourceConstants
4MAX_CAPTURE_GROUPS
MAX_CAPTURE_GROUPS :: max(#config(ODIN_REGEX_MAX_CAPTURE_GROUPS, 10), 10)Source(c) Copyright 2024 Feoramund <rune@swevencraft.org>.
Made available under Odin's license.
List of contributors:
Feoramund: Initial implementation.
VM limitationsMAX_CLASSES
MAX_CLASSES :: int = int(max(u8))SourceMAX_PROGRAM_SIZE
MAX_PROGRAM_SIZE :: int = int(max(i16))SourceODIN_DEBUG_REGEX
ODIN_DEBUG_REGEX :: _ = #config(ODIN_DEBUG_REGEX, false)SourceVariables
2Flag_To_Letter
Flag_To_Letter :: _ = #sparse[Flag]u8 {
.Multiline = 'm',
.Case_Insensitive = 'i',
.Ignore_Whitespace = 'x',
.Unicode = 'u',
.No_Capture = 'n',
.No_Optimization = '-',
}Sourcedebug_stream
debug_stream :: io.StreamSourceProcedures
1write_padded_hex
write_padded_hex :: proc(w: io.Writer, any_int, zeroes: int)Source