The regex module provides an implementation of regular expressions which adheres
closely to the POSIX Extended Regular Expressions (ERE) specification.

See https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_04

This module refers to a regular expression "match" as a [[result]]. The POSIX
match disambiguation rules are used; the longest of the leftmost matches is
returned. This implementation computes matches in linear time.

	const re = regex::compile(`[H|h]ar(e|riet)`)!;
	defer regex::finish(&re);

	assert(regex::test(&re, "Let's all love Harriet and Hare"));

	const result = regex::find(&re, "Let's all love Harriet and Hare");
	// -> {"Harriet", "riet"}
	defer regex::result_free(result);

	const results = regex::findall(&re, "Let's all love Harriet and Hare");
	// -> {{"Harriet", "riet"}, {"Hare", "e"}}
	defer regex::result_freeall(results);

	const re = regex::compile(`love`)!;
	const result = regex::replace(&re, "Let's all love Harriet and Hare",
		`celebrate`)!;
	// -> "Let's all celebrate Harriet and Hare"

	const re = regex::compile(`[a-z]+-([a-z]+)-[a-z]+`)!;
	const result = regex::replace(&re, "cat-dog-mouse; apple-pear-plum",
		`\1`)!;
	// -> "dog; pear"
