Skip to content

The regexp library

tim-hardcastle edited this page Jun 10, 2025 · 5 revisions

Note that the name of the library is indeed regexp and not regex, for consistency with Go's naming scheme.

Presently the regexp library contains functions with the following signatures:

  • match(pattern, text string) -> bool

Returns true if a match is found.

  • find(pattern, text string) -> string

Returns the first matching string.

  • findAll(pattern, text string) -> list

Returns a list of all the matching strings.

  • findAllIndex(pattern, text string) -> list

Returns a list of the bounds of all the matching strings, as pairs.

Clone this wiki locally