EMILUA(3em)
πΈ NAME πΈ
Emilua is a Lua execution engine, bestie β that's the whole title vibe. This is the EMILUA(3em) page from the Emilua reference, and 3em is the manual section, periodt. π
π¦ TYPES π¦
The type we're serving on this page:
regexβ yes bestie, a regex type. That's the star.
π Functions π
β¨ new(options: table) β regex β¨
Constructor. It builds you a regex, no cap.
options are:
pattern: stringβ the pattern to match against, literally the main character.grammarβ the grammar. Currently it has support for:"basic""extended""ecma"
ignore_case: boolean = falseβ whether to ignore casing. Default isfalse.nosubs: boolean = falseβ when performing matches, all marked sub-expressions are treated as non-marking sub-expressions.optimize: boolean = falseβ whether to optimize the regex.
π₯ FUNCTIONS π₯
π match(re: regex, str: string|byte_span) β matches... π
Try to match the pattern against the whole string str. If successful, then returns the captures from the pattern; otherwise it returns nil. If re specifies no captures, then the whole match is returned. Slay.
π¦ search(re: regex, str: string|byte_span) β table π¦
Scan through str looking for the first location where the regular expression pattern produces a match, and return a corresponding match object.
The returned table contains the following string keys:
"empty": booleanβ whether match was unsuccessful.
The table also contains numeric keys from 0 to the number of specified capture groups. 0 will represent the whole match and subsequent indexes are present if a corresponding match for that capturing group was found. Each element will be a table with the following members:
"start": integerβ the index for the first character that matched."end_": integerβ the index for the last character that matched. Yes, that'send_with an underscore, bestie.
π split(re: regex, str: string|byte_span) β string[]|byte_span[] π
Split str by the occurrences of re.
π patsplit(re: regex, str: string|byte_span) β string[]|byte_span[] π
Returns occurrences of re in str.
Okay bestie, that's the whole EMILUA(3em) page. Cute footer sign-off: source/version is Emilua 0.12.1-nixpkgs1, date is 1980-01-01, and the manual tag is EMILUA(3em). Slay and bye πβ¨
π¦ where this page comes from
- nixos 26.05: emilua 0.12.1
- nixpkgs unstable: emilua 0.12.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms