shithub: mc

ref: dbe60482e84a28a55ae6d9f5a7c9728e00f690d3
dir: /lib/regex/test/capture.myr/

View raw version
use std
use "testmatch"

const main = {
	testmatch("A(.*)", "Abc", `std.Some ["bc"][:])
	testmatch("A(.*)e", "Abcde", `std.Some ["bcd"][:])
	testmatch("(a|b)+", "abab", `std.Some ["b"][:])
	testmatch("A(b(.*)d)e", "Abcde", `std.Some [
		"bcd",
		"c"
	][:])
	testmatch("(a?)(a*)(a?)", "aaaa", `std.Some [
		"a",
		"aaa",
		""
	][:])
}