summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/regex2.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc/examples/regex2.c')
-rw-r--r--misc/examples/regex2.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/misc/examples/regex2.c b/misc/examples/regex2.c
index 20bd323c..3133f7c2 100644
--- a/misc/examples/regex2.c
+++ b/misc/examples/regex2.c
@@ -15,8 +15,8 @@ int main()
{"\\p{Han}+", "This is Han: 王明:那是杂志吗?"},
};
- c_auto (cregex, re)
- c_forrange (i, c_ARRAYLEN(s))
+ cregex re = {0};
+ c_forrange (i, c_arraylen(s))
{
int res = cregex_compile(&re, s[i].pattern);
if (res < 0) {
@@ -30,4 +30,5 @@ int main()
printf(" submatch %lld: %.*s\n", k, c_SV(j.match[k]));
}
}
+ cregex_drop(&re);
}