blob: 85291ab1ff0ce153bef3fc4d32fa2bbab718d0d7 [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()