core/text/match

text_match

Types

6

Error

Error :: enum int { OK = 0, OOB = 1, Invalid_Capture_Index = 2, Invalid_Pattern_Capture = 3, Unfinished_Capture = 4, Malformed_Pattern = 5, Rune_Error = 6, Match_Invalid = 7, }Source

Matcher

Matcher :: struct { haystack: string, pattern: string, captures: [32]Match, captures_length: int, offset: int, err: Error, // changing content for iterators iter: string, iter_index: int, }Source

Matcher helper struct that stores optional data you might want to use or not as lua is far more dynamic this helps dealing with too much data this also allows use of find/match/gmatch at through one struct

Constants

6

Variables

1

SPECIALS_TABLE

SPECIALS_TABLE :: [256]bool = [256]bool { '^' = true, '$' = true, '*' = true, '+' = true, '?' = true, '.' = true, '(' = true, '[' = true, '%' = true, '-' = true, }Source

SPECIALS := "^$*+?.([%-" all special characters inside a small ascii array

Procedures

48

gfind

gfind :: proc(haystack: ^string, pattern: string, captures: ^[32]Match) -> (res: string, ok: bool)Source

iterative find with zeroth capture only assumes captures is zeroed on first iteration resets captures to zero on last iteration

gmatch

gmatch :: proc(haystack: ^string, pattern: string, captures: ^[32]Match) -> (res: string, ok: bool)Source

iterative matching which returns the 0th/1st match rest has to be used from captures assumes captures is zeroed on first iteration resets captures to zero on last iteration

Procedure Groups

2

Reference search

Find anything

Documentation preferences

Settings

System theme variants

Used only while Theme is set to System.