Expose the pattern string, rename some procs

This commit is contained in:
Flaviu Tamas 2015-01-10 20:36:34 -05:00
commit fb51221aa8

View file

@ -37,8 +37,7 @@ suite "captures":
test "capture count":
let ex1 = initRegex("(?<foo>foo)(?<bar>bar)?")
check(ex1.captureCount == 2)
# Don't have sets, do this :<
check(ex1.captureNames == @["foo", "bar"] or ex1.captureNames == @["bar", "foo"])
check(ex1.captureNameId == {"foo" : 0, "bar" : 1}.toTable())
test "named capture table":
let ex1 = initRegex("(?<foo>foo)(?<bar>bar)?").match("foo").get