blob: 20a34eb95aa6371d53c48563c81b09a3930e88f2 [file] [log] [blame]
load("@stdlib//internal/re.star", "re")
RE = r"^(([[:graph:]]+)/)?([[:graph:]]+)$"
def test():
groups = re.submatches(RE, "abc/def")
assert.eq(groups[-2:], ("abc", "def"))
groups = re.submatches(RE, "abc")
assert.eq(groups[-2:], ("", "abc"))
groups = re.submatches(RE, "")
assert.true(not groups)
test()