EMILUA(3em)

πŸ“¦ version 0.12.1, in nixos 26.05, nixpkgs unstable

🌸 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 is false.
  • 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's end_ 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